selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
653 stars 101 forks source link

Change DECCOLM behaviour #110

Closed acroz closed 6 years ago

acroz commented 6 years ago

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:

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.

tommilata commented 6 years ago

👍

superbobry commented 6 years ago

Thanks for yet another contribution!

acroz commented 6 years ago

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.