1833150 Members
3626 Online
110051 Solutions
New Discussion

xwindows resizing

 
Luis Toro
Regular Advisor

xwindows resizing

I recently upgraded my HPUX workstation and I am experiencing the following:
I open up an 80x24 HPTERM. If I change the x-window size, the columns and rows remain 80x24.
I checked with a co-worker, and his stty settings change automatically when he maximizes his hpterms. In my research, I found a "resize" command that will fix the problem, but how do I get the stty columns and rows to change automatically when I resize an hpterm.

Thanks
6 REPLIES 6
Nicolas Dumeige
Esteemed Contributor

Re: xwindows resizing

Hello,

When I resize my xterm, the values displayed by tty are different, but I need to issue a stty cols 163 if I don't want to get an error using vi for instance like ":Terminal too wide".

Is that waht you're talking about ?

Nicolas



All different, all Unix
Luis Toro
Regular Advisor

Re: xwindows resizing

Some more details:
I have my root background menu setup to open up an HPTERM and telnet to various UNIX servers. The HPTERM window is 80x24. If I 'view' a file (ie. syslog) with long lines, I used to simply vi the file, then maximize my HPTERM window to minimize wraparound. It seems that now after I maximize the window, vi still thinks the display is 80x24 (scrolling up and down the file yields a gobbled display). 'stty -a' shows that the columns/rows are 80x24.
Looks like the 'resize' command will fix the problem after I maximize the window, but I used to not have to issue any command. In other words, the columns/rows would automatically change upon maximizing the window.
Hope this helps.
Thanks
Bill Hassell
Honored Contributor

Re: xwindows resizing

What resize does is to update the current shell variables LINES and COLUMNS. This is done automatically through the initial telnet negotiation (although not all remote clients support these subcodes, even though the standard has been around for a long time). This is why LINES and COLUMNS (and TERM) can be preset before /etc/profile is run.

In Xwindows, it gets more complicated because the window itself may be on another computer (as in running a PC with an Xwindow emulator). When you run hpterm (a modern version), resizing the window will generate the SIGWINCH signal to the current process (typically a shell) and the size variables will be updated. The problem is probably due to stating hpterm on your local workstation (which should update LINES/COLUMNS automatically in your local shell), then telnet'ing to another machine which may not support the SIGWINCH subcodes in their telnet daemon.

If the remote system has an xterm, run that on the remote machine to display back to your screen, then check LINES and COLUMNS after resizing this remote window. If that doesn't work, the remote machine apparently does not support the SIGWINCH signal even locally. If it does work, then just the telnet daemon on the remote machine is missing support for SIGWINCH (called NAWS in RFC 1073 -- NAWS = Negotiate About Window Size).


Bill Hassell, sysadmin
Luis Toro
Regular Advisor

Re: xwindows resizing

Thanks Bill.

I did not think your response applied since these are all HPUX servers that I am telneting to, running 11.0 and up. The workstation is also running HPUX 11.0. However, I followed your recommendations, and while checking the various LINES, COLUMNS, and stty settings, here's what I noticed: I only have this issue when I'm logged in as root using the Symark "pbrun" command (similar to sudo), which is most of the time. I normally telnet using my own account, then get root access via "pbrun". After that, I have the problem. If I "su -",
its fine (I'm sure I'll get a nasty-gram from Internal Security for using "su").
Unless anyone has any further insight, I guess I'll have to take this up with the Symark folks.
Mark Grant
Honored Contributor

Re: xwindows resizing

Many programs ignore SIGWINCH which I believe is the default action. We shouldn't be too hard on them, they are command line tools after all.
Never preceed any demonstration with anything more predictive than "watch this"
Bill Hassell
Honored Contributor

Re: xwindows resizing

I think you've nailed down the problem. pbrun probably creates a wide umbrella to protect root and may have issues with cetain signals. You might try sudo to see if it solves the problem. Otherwise, you may have to pick a fixed window size and start HPTERM with the desired size rather than resizing on the fly.


Bill Hassell, sysadmin