Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Mark descriptor as terminal for the -t test
- X-seq: zsh-users 21555
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Mark descriptor as terminal for the -t test
- Date: Fri, 13 May 2016 10:18:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=RsZ979pVGI78/05esMMTBy+b4QAM66K1mPaCfe6oDX4=; b=taHkT1MK+he6U+9nSH8oQaJLlU1yjcxgEX9NmBNAHYZEvr3UxvGuup2B7spEA5Le2N jg11MO/cKIpGEwSwyPgK5KuelZ4mC4wyc6j3/NRxMTRUq4wN8jHGtW8nl9GL9dkl/cBD pi93sjDBLMDACuBqgaFFkWGlBslV0t4DdZb80GT216DCzshic7QiEmIWQlcMauS7Kabi 5icV+N7d1h5PhS6bEBo1hDk+0qSwl0vLROcoYteitosDFd9YpZWa0l84NYQO/r7Ugs+q ni2qZ5wOGmROYcz1mi1FqCqmonFGcgra9JKkUq9AmvKzm0XLABm/EHyh/vKMUmH2yo7e faqQ==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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