From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a0df0384 for ; Thu, 7 Feb 2019 16:41:53 +0000 (UTC) Received: (qmail 25930 invoked by alias); 7 Feb 2019 16:41:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44052 Received: (qmail 18719 invoked by uid 1010); 7 Feb 2019 16:41:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f66.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.210.66):SA:0(-2.0/5.0):. Processed in 1.935632 secs); 07 Feb 2019 16:41:38 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tGMeoS3kt7/iFqzEEz1U5/biqi78vZON5US1ADgOCTo=; b=fvutNtTppK9TlT6hE7WAQb6QNDlUqpfDksK2BRxbigVxacu7qcldi3AjOKzT72TL1M glnpheB74xt2Dz6L51Mk+VbBnMHyi5h/SxL9hu1NXAquZWNa9K/O2XsyErCw7X/JSYNV 1vJsfTr3kRkUvFbIB0f++Cx4DOzqsXEs0p7xgxuhWpVoyTMADITsF4jezYmWiBgjkkVN DoB1c0dsqUhHEUS4rHnpnYv6C8hfNjFlU2DFDlUA4/+4FjWWgP8sUmdIcESW/iytBlrQ XKBt6E+9aYv8uG7/USM6F6izGUBJ+ABBRTAglZ7xi5nq8+G1ldScKoPEA4Ao5Vo7sHBQ fmLg== X-Gm-Message-State: AHQUAub3YRWzYOzeDszg83gz6nd1YLTGcJmHyriUEsesAlg/ICnYvOZV EEdSypfj8VPGJwvwapo5SKrgpFKMqkqC3ikemglXfg== X-Google-Smtp-Source: AHgI3IYTXaopi2HFsob4N/3cDcjSDGVpxrErB+XI308T4gC2kEjfoNvRxpwOvfLlfUGmMmOkC4mGidTqZSWEwkBUB3M= X-Received: by 2002:aca:ac13:: with SMTP id v19mr749308oie.160.1549557692668; Thu, 07 Feb 2019 08:41:32 -0800 (PST) MIME-Version: 1.0 References: <1549551768.5863.1.camel@samsung.com> In-Reply-To: <1549551768.5863.1.camel@samsung.com> From: Sebastian Gniazdowski Date: Thu, 7 Feb 2019 17:41:21 +0100 Message-ID: Subject: Re: Could multios response positively to isatty(1) test? To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 7 Feb 2019 at 16:10, Peter Stephenson wr= ote: > > 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 =E2=80=93 what's needed is the knowledge, tha= t original fd=3D1 is a tty,, and conveying that lfurther to the zsh process realizing the multios =E2=80=93 i.e.: conveying only the test answe= r to isatty(fd=3D1), 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