Zsh Mailing List Archive
Messages sorted by:
Re: Could multios response positively to isatty(1) test?
- X-seq: zsh-workers 44052
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: Could multios response positively to isatty(1) test?
- Date: Thu, 7 Feb 2019 17:41:21 +0100
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tGMeoS3kt7/iFqzEEz1U5/biqi78vZON5US1ADgOCTo=; b=tL32PRjMRUU768p4965ZrUf2Arq+oCHfhowDJqZ9Ma1aMzEhdkY7BnOurGGk0BpaaX r7QF3bzO/watvxlVzWuxwbEgLALY8YnsZ3e09guEOxBn8LUfJ0sXzoOZAmhfsVZqYZqP ICqIogmXtOABeXrB1sDfTP1B2mfv5OQBU5hUNDf8PEyYwWrR/qaC6IfIpH0koZcnb3pW DdA1onP7Aum9BGpU0DohukVHM2mUIA3gWWyNvax8XmsEgeMySB9aP6OaSehPV4acc5Uj B+MPOD6lGuJsCLGqJTsYOYrCsgcSjn7PHw0Rgm0B3PT8/4EUSuVym3WmefioSFd739+Q CtEQ==
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190207132020epcas2p21907126ab733665c20d5881eb13488ef@epcas2p2.samsung.com> <CAKc7PVAdyyvBAmpMHpiBt4=_C9aMnGz88Fy1h1OYhAdNOX5qOQ@mail.gmail.com> <firstname.lastname@example.org>
On Thu, 7 Feb 2019 at 16:10, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> On Thu, 2019-02-07 at 14:18 +0100, Sebastian Gniazdowski wrote:
> > Hello,
> > If at least one of the outputs of the multios-utilizing invocation is
> > to a terminal, .e.g
> > print "$fg[blue]A TEST$reset_color" \
> > > >(ansifilter >>! "log.txt") 1> >/dev/tty
> > then could Zshell answer positively to the isatty(1) test for the
> > application (like e.g. vim) placed the way that the print-command is?
> > Is this doable?
> The short answer's no. Implementing pty support in the core shell would
> be a bug-prone maintenance disaster.
Implementing isn;'t necessary – what's needed is the knowledge, that
original fd=1 is a tty,, and conveying that lfurther to the zsh
process realizing the multios – i.e.: conveying only the test answer
to isatty(fd=1), not the terminal implementation. Simple forwarding of
all data to the terminal through non-terminal. works (a good test: vim
I wonder what the test (isatty(1)) does. Does it invoke some ioctl()
that somehow reaches the zsh multios-process.. No rather not, but what
then? Maybe some flag on the fd: that is visible to the
> You're best bet is some kind of pty wrapper (as already discussed) plus
> something looking a bit like tee. This is not stuff you want within zsh
> (unless as an add-on --- but zpty is bad enough to maintain, so I wouldn't
> recommend even that).
Messages sorted by: