fix(ansi): emit DECSWT/DECSIN with correct OSC numbers and ST#865
Open
c-tonneslan wants to merge 1 commit into
Open
fix(ansi): emit DECSWT/DECSIN with correct OSC numbers and ST#865c-tonneslan wants to merge 1 commit into
c-tonneslan wants to merge 1 commit into
Conversation
DECSWT was emitting OSC 2;1;name ST instead of OSC 21;name ST because it was constructed by prepending '1;' onto SetWindowTitle (OSC 2). Same shape for DECSIN: OSC 2;L;name instead of OSC 2L;name. Real VT520/VT525 ignore the broken forms. The terminator also flipped from BEL to ST, which the spec requires. Most modern emulators accept either, but real VTs don't. Closes charmbracelet#813. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
`DECSWT` was producing `OSC 2;1;name ST` because it prepended `1;` onto `SetWindowTitle` (which is `OSC 2`). The spec is `OSC 21`. Same shape on `DECSIN`: was `OSC 2;L;name`, should be `OSC 2L;name`.
While I was here I also switched the terminator from `BEL` to `ST` (`ESC \`) since that's what the EK-VT520 reference specifies. Modern emulators accept either, but a real VT520/VT525 keeps eating the title until it sees an `ESC`.
Sequences cross-checked against the EK-VT520-RM that the docs link to, sections 5–156 and 5–134. Added tests for both.
Closes #813.