Skip to content

fix(ansi): emit DECSWT/DECSIN with correct OSC numbers and ST#865

Open
c-tonneslan wants to merge 1 commit into
charmbracelet:mainfrom
c-tonneslan:fix/ansi-decswt-decsin-sequences
Open

fix(ansi): emit DECSWT/DECSIN with correct OSC numbers and ST#865
c-tonneslan wants to merge 1 commit into
charmbracelet:mainfrom
c-tonneslan:fix/ansi-decswt-decsin-sequences

Conversation

@c-tonneslan

Copy link
Copy Markdown

`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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DECSWT and DECSIN escape sequences are incorrect

1 participant