Closed acroz closed 7 years ago
Hi Andrew,
This is very old code and frankly I don't remember the original motivation. The only mention of that in VT220 manual I've found is
4.6.10 Column Mode (DECCOLM)
Column mode selects the number of columns per line (80 or 132) on the screen. The screen can > display 24 lines of text with either selection.
You select the number of columns per line as follows.
NOTE: When the terminal receives the sequence, the screen is erased and the cursor moves to the home position. This also sets the scrolling region for full screen (24 lines).
it doesn't say anything about DECOM
and I too can't justify the need to reset it. After the scrolling region is updated, DECOM
should work fine.
I've pushed a commit removing the reset. Thank you for drawing my attention to this.
Thanks for looking in to this.
I'm trying to understand the screen resizing logic in pyte and could use a little guidance. On screen resize, pyte resets the DECOM mode:
https://github.com/selectel/pyte/blob/26866c70e37b7ba00aaea3cf89fed50cd4f5cd7f/pyte/screens.py#L325
This has the effect of resetting the cursor position:
https://github.com/selectel/pyte/blob/26866c70e37b7ba00aaea3cf89fed50cd4f5cd7f/pyte/screens.py#L386
A comment in
Screen.set_mode
indicates that resetting the cursor is required by vttest, however it's not clear to me why resetting the DECOM mode is necessary on every resize.Effect of cursor reset
The main reason this is of interest to me is that resetting the cursor on every screen resize gives undesirable behaviour. Consider this example:
This writes some lines to a small screen and gives the output:
If I then resize the screen and write more content:
the cursor is reset, and further writes to the screen overwrite previous lines rather than continuing at the bottom as expected:
What's the point?
My current solution to this is to subclass
Screen
and overrideresize
with thereset_mode
call removed, but I would like to understand if this is a reasonable thing to do.Thanks for any assistance you can give!