Welcome to iraf.net Sunday, April 28 2024 @ 07:35 AM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 wrong identification of terminal size, bad $ttynlines
   
msz1959
 03/24/2012 12:00PM (Read 4978 times)  
+----
Newbie

Status: offline


Registered: 09/22/2009
Posts: 6
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.When IRAF is started in xterm/xgterm window, it does not get the size of the terminal window properly, although, as mentioned by Mikes's reply to that 2000 post, it should (see https://iraf.net/phpBB2/viewtopic.php?t=76544&sid=6fdf5737a4565504bafb645c55b43099).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
set ttynlines=envget("LINES")
into login.cl file, somewhere after the "stty xterm" command.Maybe it could be just fixed - cannot be a difficult job.regards, Michal.

 
Profile Email
 Quote
fitz
 03/24/2012 12:00PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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?

 
Profile Email
 Quote
msz1959
 03/24/2012 12:00PM  
+----
Newbie

Status: offline


Registered: 09/22/2009
Posts: 6
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 .cshrcIf 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
24 80
> cl
vocl> stty
xgterm ncols=80 nlines=40
vocl> stty resize
timeout - terminal type set wrong? (`stty termtype' to reset)
vocl> stty xterm resize
vocl> stty
xterm ncols=80 nlines=65
vocl> 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.

 
Profile Email
 Quote
fitz
 03/24/2012 12:00PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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?

 
Profile Email
 Quote
msz1959
 03/24/2012 12:00PM  
+----
Newbie

Status: offline


Registered: 09/22/2009
Posts: 6
Sorry if I did not put it clear enough.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.

 
Profile Email
 Quote
fitz
 03/24/2012 12:00PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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?

 
Profile Email
 Quote
   
Content generated in: 0.19 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login