Tcl Library Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: e048d94427a1c479213ffa91bf36be7546a2b464
Title: ::term::ansi::ctrl::unix terminal dimensions functions work incorrectly
Type: Bug Version: 1.17-dfsg-1 (debian)
Submitter: anonymous Created on: 2015-12-10 18:11:56
Subsystem: term Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2015-12-10 18:11:56
Resolution: None Closed By: nobody
    Closed on:
This seems to be utilizing tput, and assuming that tput uses stdin to get it's parameters, but that seems to not be the case. And things like:

echo 'puts [exec tput lines]' | tclsh

does not work (nor does it in script), same with:


"tput lines", though, works on interactive tclsh. This was rather nasty thing, but #tcl user rkeene helped me to find workaround/fix to this:

echo 'puts [exec tput lines 2>@ stderr]' | tclsh

works, as does:

echo 'puts [exec -ignorestderr tput lines]' | tclsh

(of course works in script too) so it seems (as far as I understand) tput needs to be connected to tty's stderr to work correctly. Currently tcllib functions always return 80 for columns and 24 for rows. And current solution to this is rather obscure to say the least...