-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable DECCOLM support via a private mode escape sequence #1709
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thanks!
Curious: What happens in xterm if you |
Good questions. First off, private mode 40 doesn't seem to be affected by anything other than the As for In the Windows terminal it seems the full original buffer is restored, but not the original size, so you'll get a horizontal scroll bar. This doesn't seem unreasonable either, but it's not exactly compatible with XTerm. So that may well be something you want to fix, but I think it's probably orthogonal to the Another difference I noticed in testing now is that XTerm resets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thanks for working on it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this.
🎉 Handy links: |
Summary of the Pull Request
While the DECCOLM escape sequence is technically implemented, it's disabled by a flag that is not user-accessible. This PR adds support for an escape sequence (XTerm's private mode 40) which essentially enables that flag, so users can turn on DECCOLM support in an XTerm-compatible way. Tested manually, with Vttest, and with unit tests.
PR Checklist
Detailed Description of the Pull Request / Additional comments
My initial plan was to build this on top of the existing
_fIsSetColumnsEnabled
flag, but after further investigation that proved not to be practical. In order to be compatible with XTerm, the flag needs to be checked in the_DoDECCOLMHelper
method rather than inSetColumns
, since it needs to prevent all facets of the DECCOLM operation taking effect - not just the column sizing.And in the future, if the
SetColumns
method is also going to be used to support the DECSCPP escape sequence, that will need a flag of its own - it's not controlled by the same option as DECCOLMN.For those reasons, I've removed the existing
_fIsSetColumnsEnabled
flag and added a new_fIsDECCOLMAllowed
flag which is checked in the_DoDECCOLMHelper
method. I've then added aEnableDECCOLMSupport
method to toggle that flag, and added a case in_PrivateModeParamsHelper
to call that method in response to the private mode 40 sequence.While I did mention my initial plans on issue #171, I never actually got feedback from core contributors, so I completely understand if this PR is rejected in favour of a different approach. I'm just offering it as one possible solution.
Validation Steps Performed
I've added an output engine unit test which validates that the private mode escape sequences trigger the
EnableDECCOLMSupport
call, and some screen buffer unit tests which check that the DECCOLM sequence does take effect when allowed, and doesn't do anything when disallowed.I've also done a fair amount of manual testing, and run several of the Vttest suites which toggle between 80 and 132 column modes, and which now work (at least in terms of column width) where previously they didn't.