Currently, exiting DECCOLM mode always set the width of the terminal to 80 columns. This PR changes the behaviour to restore the number of columns the terminal had before entering DECCOLM mode.
This change is motivated by the fact that running reset in Ubuntu outputs (among other things) the control sequence \x1b[?3;4l, meaning reset private modes 3 and 4. Resetting private mode 3, DECCOLM, causes the screen width to be set at 80 characters. This causes a deleterious experience for the users of our web terminal program being developed around pyte. For example:
A user creates a terminal of 100 character width
Some time later, the user uses the reset command, sending the DECCOLM reset control sequence
The user's terminal is modified to 80 characters in width
This produces a confusing experience for our users, as despite never having had the terminal in 80 characters width previously, it is now in that width until modified again by the user.
This PR modifies the behaviour in pyte to match that of xterm.js, which is to store the terminal width on setting DECCOLM mode and restoring that (if existing) on resetting DECCOLM.
No problem! Have you had any thoughts on my other PRs (and that of @zblz)? As I mentioned by email I'm happy to talk about them by Skype etc if you prefer.
Currently, exiting DECCOLM mode always set the width of the terminal to 80 columns. This PR changes the behaviour to restore the number of columns the terminal had before entering DECCOLM mode.
This change is motivated by the fact that running
reset
in Ubuntu outputs (among other things) the control sequence\x1b[?3;4l
, meaning reset private modes 3 and 4. Resetting private mode 3, DECCOLM, causes the screen width to be set at 80 characters. This causes a deleterious experience for the users of our web terminal program being developed around pyte. For example:reset
command, sending the DECCOLM reset control sequenceThis produces a confusing experience for our users, as despite never having had the terminal in 80 characters width previously, it is now in that width until modified again by the user.
This PR modifies the behaviour in pyte to match that of xterm.js, which is to store the terminal width on setting DECCOLM mode and restoring that (if existing) on resetting DECCOLM.