Zsh Mailing List Archive
Messages sorted by:
Re: Mark descriptor as terminal for the -t test
- X-seq: zsh-users 21600
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Mark descriptor as terminal for the -t test
- Date: Wed, 1 Jun 2016 21:45:28 -0700
- 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==
- In-reply-to: <CAKc7PVAvHk_DUx=Lid_vKBzFw9B3CSuDu7d8LmtzqV8AtgNcnA@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAvHk_DUx=Lid_vKBzFw9B3CSuDu7d8LmtzqV8AtgNcnA@mail.gmail.com>
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.
Messages sorted by: