Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Could multios response positively to isatty(1) test?



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.

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



Messages sorted by: Reverse Date, Date, Thread, Author