FS#7294 - base/initscripts: Make isatty a little more useful.
Attached to Project:
Arch Linux
Opened by Andrew Fyfe (space-m0nkey) - Monday, 28 May 2007, 20:11 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 12 September 2007, 15:40 GMT
Opened by Andrew Fyfe (space-m0nkey) - Monday, 28 May 2007, 20:11 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 12 September 2007, 15:40 GMT
|
Details
Attached is an extended version of isatty that lets you pass
which tty you won't to check so you can check stdout and
stderr.
|
This task depends upon
Closed by Dan McGee (toofishes)
Wednesday, 12 September 2007, 15:40 GMT
Reason for closing: Won't fix
Additional comments about closing: isatty no longer necessary
Wednesday, 12 September 2007, 15:40 GMT
Reason for closing: Won't fix
Additional comments about closing: isatty no longer necessary
if [ $(isatty 2) ]; then
STAT_COL=$[`stty size | awk 'BEGIN { RS=" " }; END { print $1 }'` - 13]
else
STAT_COL=$((80 - 13))
unset $USECOLOR
fi
http://archlinux.org/pipermail/arch-dev-public/2007-August/001436.html
for a hopeful fix. Suggestions here were incorporated, please give me feedback by trying out the package in testing.
Notice that I removed isatty entirely- the bash option -t seems to do everything we need.