zsh-users
 help / color / mirror / code / Atom feed
* Mark descriptor as terminal for the -t test
@ 2016-05-13  8:18 Sebastian Gniazdowski
  2016-06-02  4:45 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Gniazdowski @ 2016-05-13  8:18 UTC (permalink / raw)
  To: Zsh Users

Hello
One can test if a descriptor is connected to terminal with -t.

if [ ! -t 0 ]; then
    echo "Stdin is not from terminal"
fi

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?

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.

Best regards,
Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-03 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13  8:18 Mark descriptor as terminal for the -t test Sebastian Gniazdowski
2016-06-02  4:45 ` Bart Schaefer
2016-06-03 16:30   ` Sebastian Gniazdowski
2016-06-03 18:33     ` Bart Schaefer

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).