zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Mark descriptor as terminal for the -t test
Date: Fri, 13 May 2016 10:18:22 +0200	[thread overview]
Message-ID: <CAKc7PVAvHk_DUx=Lid_vKBzFw9B3CSuDu7d8LmtzqV8AtgNcnA@mail.gmail.com> (raw)

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


             reply	other threads:[~2016-05-13  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13  8:18 Sebastian Gniazdowski [this message]
2016-06-02  4:45 ` Bart Schaefer
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='CAKc7PVAvHk_DUx=Lid_vKBzFw9B3CSuDu7d8LmtzqV8AtgNcnA@mail.gmail.com' \
    --to=sgniazdowski@gmail.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).