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 37bda47a for ; Thu, 7 Feb 2019 13:00:48 +0000 (UTC) Received: (qmail 12822 invoked by alias); 7 Feb 2019 13:00:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23862 Received: (qmail 12361 invoked by uid 1010); 7 Feb 2019 13:00:27 -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 2.215287 secs); 07 Feb 2019 13:00:27 -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=GTNCkNdutu8dPR0hr4pdiHVUo515zvyeuBQMSAaGIwY=; b=RkmyN1V3KrLJohUG1onWckkmj15wLZ/o4otIQBwlYtVVZoQfkhAqryOTZpuAUkiQQM fMszO9xr5n2uoGKDZJEXaXT4fptBifCDbDLeOkmRvXrL2L28u5XZ4ZzGFRl7XtWYDTRx DGQAKHYZLOKPQhRCKGbG1j9f+jcfC/LD4EtsnHUNg83FvLOYw0Rtruj1XU8pgOdBvCvK C8er1h2igNoEMObasXqqOOIVM2qez5SlA4gI+dOKBmUvqDiJlZVLpOi3yk6mHcS07PUE QCuLrVq7nouJnELPaAJUFxYia8c9ckPgsjg/mexxH/RHu7RZS5t5Q6lUHE2eR6ifAGxw mIMA== 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=GTNCkNdutu8dPR0hr4pdiHVUo515zvyeuBQMSAaGIwY=; b=AdS2Vxk6Py7beNS5sD+LZHAhg8tAaqAqtRfW/pDSq6f2pITdQzjNtSjYeV1UqFyYHX POcYzbQvdThgoTYo6LVMzK1S54rIQHT4PhMXyf623qcn7UQuIlRlnGooLdh4rRF9oOBN TNCLsNkDpImD3rsJJ7O6a9K4Bq4J/USpI4LTZLq3JEiByNIOho6wMy91RJoV/WsQWSO8 TKYTxzQJAfu+mxKOgGHZ5VHEmTKq47pJP9ecCYC5OL3W7YDUeGXU5oSVeFM50bN5EUlZ ApiqTtYSNCl5gXPQiyddikpErdCVCr+uL6rxtsJvoJteEe/j0PqvkyO8eIhZUbOFwQj9 rcCQ== X-Gm-Message-State: AHQUAuab/cOz1sDR6PXUwqXlD4YhkAu5GctW2GYZTia7MFsSsT/SI8GS RKaVs2DcYbNo+2dvy03p+udTNy8nkeGntWQTA71KAcqY X-Google-Smtp-Source: AHgI3IbKfCcgO9ISQKMzxFgSyu5cP+gQGjhREln2v+mtPpUoa6aZTOIQhEwsRXL3Mjj0O8YonDqwUfFAp76Uh7QMi08= X-Received: by 2002:a54:438b:: with SMTP id u11mr198186oiv.51.1549544423100; Thu, 07 Feb 2019 05:00:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Thu, 7 Feb 2019 14:00:10 +0100 Message-ID: Subject: Re: Why multios affects >/dev/tty redirection? To: Philippe Troin Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 5 Feb 2019 at 17:43, Philippe Troin wrote: > That's because when you use multios, the stdout (and other multios > descriptors) are not connected to a real terminal, but to a pipe > connected to the invoking zsh process, zsh then sends the output to > multiple files or devices. > Because scrapy is not connected to a real terminal, it behaves > differently. I wonder if it's not fully on scrappy's side, i.e. that in such situation there are no actual obstacles in providing a working terminal-grasping app, which is rather proved by vim | cat working just normally. I.e. if it's scrapy that does a ttty-test (i.e. calls isatty()) and decides to provide a limited application. This is again fully proven by the fact that this command: vim > >(ansifilter > ansi.txt) > /dev/tty Works as expected =E2=80=93 i.e. vim outputs a warning about output being n= ot to a terminal, and then works without a single flaw, i.e. cursor-keys, home, end keys also working fine. So could Zshell answer positively to the isatty() call, if at least one of the multios-outputs is a terminal? I think there's a big meaning, sense in this, however I don't want the email to be verbose. > > Is there a way around this? > > I wrote a long time ago an enhanced version of that tool called ptyopen > ( http://ftp.fifi.org/phil/ptyopen/ ) that does the same thing. > > You'd invoke it like: > > ptyopen scrapy crawl 2nd "$@" "${optarray[@]}" 2> /tmp/reply 2> /dev/= tty 1> /tmp/reply 1> /dev/tty > > It then creates a pseudo-terminal, launches scrapy in it, and the pty > output can then be used transparently with multios. Interesting tool, however I cannot use it, because my client doesn't want advanced, custom things, even a shell-scripts are questioned (the project is in python). --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org