From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14052 invoked by alias); 2 Jun 2016 04:45:35 -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: X-Seq: 21600 Received: (qmail 14274 invoked from network); 2 Jun 2016 04:45:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=uoNFrhy3JxyDi9cH5kAnx2g22/Ki7KtSnv3b14yud3M=; b=t4rUwAGmv7eHVsGKIz7bt3KbqzPm4qEmtRm0pbJ681/O+NMDdI5lEtvCuVioivE1aK 8/ncVmOlXOnKyGAv6iT6Z7y3GPA6EJyEq4XEA+L/d3sjneZ/8TWd2Shv7XyIkxR1pp1H ATA5+mg5O2sqrCDriUJwhawh0jY3SQcJO/xYKsz6mnN19aCAQefseY06iCPbiQyCzxqV PBmPZfkMqyHgYHCVknehesbelJEyHNL2Eo9uz10Prsn+2EuwJ7//+T7ZjUq6RF5JMFFa uznlSJHWrWCuH4KskBgNXJ5U/ZprDbsrqlIZrjK7/EIQdYP2V63qr1jeF10hjzYUhc6z Q9mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=uoNFrhy3JxyDi9cH5kAnx2g22/Ki7KtSnv3b14yud3M=; b=kAKMrRSOtiJduw6U9+2+y9Jhn9+w0P0RXkzp579Tn0tSnt+6MPpmIsPpFg8EwMbI2r rQDmzlkUwm42T4o7viaT0cBSNq+9LztAq3qOcDUsCPo2ye5vJIfx+T++FRnWVTuhXfx8 DZswJQvRJOWnZGLsjgXCnVhOWwYJAf2NFDOSYaXi5TQRbRMxTGsisigp89k1n9c/fB3a QDGW5esNSb5izB3Ux0bssg/lBETRgk/TsDVmvaenv/LX77z4ssLzzJiDLnwqwBfl32VK g/SSSCBIQ73eztAYfnA1ziW/ZP7sBmvrc+8XqJxxmsxB/8lpC7bnmgjSoiBR04fabHzx WrHg== X-Gm-Message-State: ALyK8tLyPb7kbI7fUMUNLYk9usMBlVmcIyvnCCpATZeJOqsUgsWWRDWrJ1foFB4UfQhgZA== X-Received: by 10.98.157.4 with SMTP id i4mr811173pfd.31.1464842731486; Wed, 01 Jun 2016 21:45:31 -0700 (PDT) From: Bart Schaefer Message-Id: <160601214528.ZM14311@torch.brasslantern.com> Date: Wed, 1 Jun 2016 21:45:28 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Mark descriptor as terminal for the -t test" (May 13, 10:18am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Mark descriptor as terminal for the -t test MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Just returned from a trip where I had limited email access, so several things to catch up on, maybe over a few days ... On May 13, 10:18am, Sebastian Gniazdowski wrote: } Subject: Mark descriptor as terminal for the -t test } } Having a descriptor X, pointing to a file or to a process (with >(cmd) } redirection), is it possible to make it look like terminal? For the } test -t to pass? No. The "is a terminal" state is at the OS level; the descriptor must refer to a tty device file. } The goal is: make this more robust: } exec > >(tee -a ~/$$.out) } } It works, catches output of commands, however e.g. from vim, message } about "output is not to a terminal" appears. Almost any interactive command will be confused or broken by that usage. This is the reason that e.g. the "script" command exists. I presume this is related to your "ztrace" project. I fear you're doomed to failure with that one, except in a very simple cases. It is theoretically possible to do something with the "zpty" module, but keeping all the I/O in sync when an interactive command wants curses-type functionality is extremely tricky, and you have to manage all keyboard signals to propagate them through.