From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Mark descriptor as terminal for the -t test
Date: Wed, 1 Jun 2016 21:45:28 -0700 [thread overview]
Message-ID: <160601214528.ZM14311@torch.brasslantern.com> (raw)
In-Reply-To: <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.
next prev parent reply other threads:[~2016-06-02 4:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 8:18 Sebastian Gniazdowski
2016-06-02 4:45 ` Bart Schaefer [this message]
2016-06-03 16:30 ` Sebastian Gniazdowski
2016-06-03 18:33 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160601214528.ZM14311@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).