'tput cols' give strange results

Bug #187866 reported by Yves Le Berre
4
Affects Status Importance Assigned to Milestone
ncurses (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
-----------------------------------------------------------------------------------------------------------------------------------------------
dpkg -l ncurses-bin | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Nom Version Description
+++-==============-=====================-============================================
ii ncurses-bin 5.6+20070716-1ubuntu3 Terminal-related programs and man pages
-----------------------------------------------------------------------------------------------------------------------------------------------
root@ganymede:~# ps -ef | grep [g]nome-term
root 6132 1 0 09:48 ? 00:00:07 gnome-terminal --geometry=110x36

root@ganymede:~# echo $COLUMNS
110
root@ganymede:~# tput cols
110
root@ganymede:~# COLS=$(tput cols)
root@ganymede:~# echo $COLS
110
root@ganymede:~# COLS=$(tput cols 2>/dev/null)
root@ganymede:~# echo $COLS
80
root@ganymede:~# tput cols 2>/dev/null
110
-----------------------------------------------------------------------------------------------------------------------------------------------

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.
Confirmed in Intrepid. Same result with lines which returns 24 instead of 36.

$ apt-cache policy ncurses-bin
ncurses-bin:
  Installed: 5.6+20071124-1ubuntu2

Revision history for this message
Thomas Dickey (dickey-his) wrote :

It's expected behavior - in the "80" case, stdout is redirected,
so it's no longer a terminal. When this happens, the terminal
initialization falls back to the terminfo settings.

Changed in ncurses (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.