Posted: Sat Mar 24, 2012 12:00 pm Post subject: wrong identification of terminal size, bad $ttynlines
I have always had this problem, for decades already, starting on SunOS machines, then Solaris and all sort of Linuxes. It is really strange that almost nobody complains (I just found one post from 2000). Very unlikely that only I have this problem.
Whatever the true size is, 'stty xterm' sets ttynlines to 65, 'stty xgterm' to 40, probably according to some hardcoded defaults. 'stty resize' does not work.
Needless to mention, 'stty size' in the system shell (outside IRAF) shows the right size, there are also COLUMNS/LINES env variables set properly. All other terminal-based software (editors etc.) recognize the size w/o any problem.
For all those years, I have been using a workaround, putting
into login.cl file, somewhere after the "stty xterm" command.
Maybe it could be just fixed - cannot be a difficult job.
Specifically what platform is giving you this problem? I just tried "stty resize" on OSX and Linux, xterm and xgterm, and got the correct size before and after resizing the window in both cases.
Terminal sizes of 65 and 40 rows are the default only of you use 'xterm' or 'xterm40' as the reply to the terminal type prompt for a MKIRAF. Is there an 'stty' or a 'tset' command in your .cshrc file that could be resetting things? Do you start xterm/xgterm with any special command-line flags?
At home, I use latest IRAF 2.16 on Ubuntu 11.04. At work, 2.15 on RHEL 5.x and MacOSX. There is no tset/stty in my .cshrc
If I do not give "xterm" at mkiraf prompt, just a lone "stty" w/o parameters is added to login.cl and it defaults to xgterm, 40 lines, which os both wrong for a xterm window of 24 lines. If I give "xterm", "stty xterm" appears in login.cl and it defaults to 65 lines.
Excerpt from my session:
> xterm & (from a gnome-teminal, just to be pure-xterm)
in the freshly open xterm:
> stty size
xgterm ncols=80 nlines=40
vocl> stty resize
timeout - terminal type set wrong? (`stty termtype' to reset)
vocl> stty xterm resize
xterm ncols=80 nlines=65
If I give "xterm" to mkiraf, it is almost the same, just without resetting xgterm to xterm.
I have just found that it is a bit better in xgterm. "stty resize" seems to work. if so, it should probably be automatically added to login.cl by mkiraf script. If not, nlines defaults to 40.
It sounds like you're using an XTerm window, but keeping the 'xgterm' terminal setting. In this case, an 'stty resize' in fact doesn't get the correct size, but when using a real XGterm window will work as expected. Can you verify that when using the xterm/xgterm window and the appropriate termtype setting the resize works?
If I run IRAF in an XTerm window, set-up as xterm (i.e. with "stty xterm" line in 'login.cl'), the no. of lines gets set to 65 and 'stty resize' does NOT work.
In a XGterm window, with IRAF set-up as xgterm ("stty xgterm" in 'login.cl'), the no. of lines is set properly and then, if I change the window size manually without leaving the IRAF, "stty resize" does set the window new size properly.
This appears to be non-trivial to fix. The escape sequence to report the window size no longer appears to be recognized by XTerm and so when you type 'stty resize' the sequence is sent but no response is ever received, and so the hardwired value in the termcap is used.
I can't say specifically when this started but I know XTerm underwent a major rewrite a while ago. It appears that even though the man page says the sequence should work, it seems to reply on applications processing a SIGWINCH signal to respond to the resize. Your envget() workaround is fine when you first login, but needs to be done again if the window is resized. That and the SIGWINCH handling means nontrivial.
Just curious, is there some reason you use XTerm over XGterm anyway?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum