Skip to content
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

Fix some incorrect SGR codes #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TBBle
Copy link

@TBBle TBBle commented Jul 14, 2021

I came across this as a suggested test suite for Windows Terminal, and while trying it out, I hit a few issues:

  • The 'Rapid blink' line continued blinking in the no-blink section
  • The SGR 38 and 48 colour parameters incorrectly implemented the ITU T.416-conformant layout.

Windows Terminal doesn't currently implement the latter, but there was a fair bit of research done on microsoft/terminal#4321 as preparation work. Per https://gist.github.com/XVilka/8346728#gistcomment-2774523 there is some ambiguity in the specification, so for the purposes of this repo, it might make sense to make that change toggleable as well?

TBBle added 2 commits July 15, 2021 05:30
The test-script is incorrectly using SGR 26 to cancel SGR 6, but SGR 5
and SGR 6 are _both_ cancelled by SGR 25. SGR 26 is unrelated.

This fixes the issue that the 'no rapid blink' text is blinking in
Windows Terminal, which implements all of SGR 5, 6 and 25; although it
does not differentiate SGR 5 and SGR 6's blink speed.

References:
* https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
* Page 61 of https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf
* https://www.real-world-systems.com/docs/ANSIcode.html

Signed-off-by: Paul "TBBle" Hampson <[email protected]>
Per the standard, the `:` character is the separator for the elements of
the parameter substring. However, the parameter substring itself is
still separated from the SGR value using `;`.

References:
* 13.1.8 of ISO/IEC 8613-6:1994 (E), aka IT-T Rec. T.416 (1993 E)
* https://github.com/csdvrx/sixel-testsuite/blob/master/ansi-vte52.sh

Signed-off-by: Paul "TBBle" Hampson <[email protected]>
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.

1 participant