Ticket #20 (closed defect: fixed)

Opened 3 years ago

Last modified 6 months ago

stty dynamic sizing problem

Reported by: perry Assigned to: somebody
Priority: normal Milestone: PyRAF 1.6
Component: none Version: 1.1.2
Severity: minor Keywords:
Cc:

Description

Hi Phil, I imagine you've identified an area where my model how things ought to behave was incomplete. My assumption is that ttylines is always supposed to be up-to-date when a task is started and should reflect the actual number of lines on the display. The irafexecute task startup takes care of that by always querying the display size and sending the info to the task. The stty nlines and ncols parameters are actually pretty much ignored as far as I can tell.

If you can describe how these various parameters ought to behave, I expect this could be fixed pretty easily. At the moment the ttynlines and ttyncols parameters get updated by running 'stty resize', but otherwise only the tasks see the correct up-to-date values. I'm not sure how this should be changed.

Do you have scripts where you actually need to know the window size?

Cheers, Rick

On Tue, 9 Mar 2004, Phil Hodge wrote:

Pyraf seems to have some conflicting info regarding the size of my terminal window. My window has 24 lines and 80 columns. page works correctly, i.e. when I hit the space bar, page displays the next page of text, without overlap and without a gap. If I resize the window, the size reported by stty is unchanged.

Phil

PyRAF 1.1 (2003Oct17) Copyright (c) 2002 AURA Python 2.3 Copyright (c) 2001, 2002, 2003 Python Software Foundation. Python/CL command line wrapper

.help describes executive commands

--> stty xgterm ncols=80 nlines=40

--> print pyraf.wutil.getTermWindowSize() (24, 80) # this is correct

--> show ttynlines 40

--> stty xtermjhs --> stty xtermjhs ncols=80 nlines=40

--> stty nlines=24 --> stty xtermjhs ncols=80 nlines=40

Change History

03/05/08 15:57:15 changed by sontag

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to PyRAF 1.6.

Fixed by r831. If there is a "stty <term-name>" line in the user's login.cl (as is the default), then the correct dimensions of the terminal will be used. The "stty" command will then show the appropriate number of lines & cols. Otherwise, these values will be set any time the user calls:

   stty <term-name>

or

   stty resize

The code was not changed to automatically update the dimensions upon a call to "stty" after a window resize. It seems the original intent was to have the user call "stty resize" in this case. In addition, it might be confusing that ttynlines and ttyncols stayed static immediately after a resize (and thus incorrect) but then corrected themselves upon the next call to stty (even without setting them in the call).

What might be really slick however, would be to catch the terminal resize event and automatically perform the "stty resize", but that is beyond the scope of this ticket, and it is not clear how much use it would get.