bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tput returns wrong value?


From: S . Loebner
Subject: tput returns wrong value?
Date: Fri, 22 May 2009 15:34:52 +0200

Dear maintainers of ncurses,

recently i discovered a strange behavior of tput showing by the following code 
example. 

$cat testscript 
tput cols
i=$( tput cols )
echo $i

$./testscript 
109
109

$./testscript 2> /dev/null
109
80


As you can see the variable $i has the wrong value if the stderr chanel is 
redirected. Maybe this behavior is intended. I found it rather annoying and 
would know if this is correct.
At first i thought there is something wrong with bash but since it also fails 
on zsh i am writing you :-)

I tested it on bash 3.2 and zsh 4.3.9

Thanks in advance for thinking about it!
Sebastian

P.S. 
It only occurs when you put it in a file and execute the script:

$ tput cols; foo=$( tput cols ) ; echo $foo 2> /dev/null
109
109

See.. it works. So it seems to me that 80 is kind of a default value.
-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02




reply via email to

[Prev in Thread] Current Thread [Next in Thread]