Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Mark descriptor as terminal for the -t test



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



Messages sorted by: Reverse Date, Date, Thread, Author