Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
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: <1549551768.5863.1.camel@samsung.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190207132020epcas2p21907126ab733665c20d5881eb13488ef@epcas2p2.samsung.com> <CAKc7PVAdyyvBAmpMHpiBt4=_C9aMnGz88Fy1h1OYhAdNOX5qOQ@mail.gmail.com> <1549551768.5863.1.camel@samsung.com>
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
| cat).
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
application/writer?
> 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).
>
> pws
>
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author