The DEC special graphics character set shouldn't have control characters #247

Closed
opened 2026-01-30 21:46:46 +00:00 by claunia · 3 comments
Owner

Originally created by @j4james on GitHub (May 5, 2018).

  • Your Windows build number:

Microsoft Windows [Version 10.0.16299.371]

  • What you're doing and what's happening:

When I use the ESC ( 0 escape sequence to enable the DEC special graphics character set, some of the characters don't seem to be correctly mapped. Specifically, code points \x62 to \x65, \x68, and \x69, which are meant to be glyphs representing the control characters (␉ ␌ ␍ ␊ ␤ ␋), and shouldn't be interpreted as the control characters themselves.

It's admittedly not particularly obvious from the mapping table provided in the VT100 manual, but I think it's a lot clearer in the VT220 manual, which lists both control characters and control character glyphs, so you can clearly see the difference.

As further confirmation, every Linux terminal emulator I've tested has displayed these code points as glyphs and not interpreted them as control characters. Here is a simple test case:

printf "\e(0[b][c][d][e][h][i]\e(B\n"

The screenshot below shows the output from XTerm, Gnome Terminal, Konsole, and the Windows console.

image

And note that the two characters that Windows does appear to display (with a replacement char) are still not correct. Those are being mapped to the "form feed" and "vertical tab" control characters, which Windows doesn't implement. If you had a font that supported those glyphs you'd see them as characters \x0C and \x0B (♀ and ♂) from code page 437.

  • What's wrong / what should be happening instead:

When the DEC special graphics character set is enabled, code points \x62 to \x65, \x68, and \x69 should be displayed as glyphs and not interpreted as control characters.

Originally created by @j4james on GitHub (May 5, 2018). * Your Windows build number: Microsoft Windows [Version 10.0.16299.371] * What you're doing and what's happening: When I use the `ESC ( 0` escape sequence to enable the DEC special graphics character set, some of the characters don't seem to be correctly mapped. Specifically, code points \x62 to \x65, \x68, and \x69, which are meant to be glyphs representing the control characters (␉ ␌ ␍ ␊ ␤ ␋), and shouldn't be interpreted as the control characters themselves. It's admittedly not particularly obvious from the mapping table provided in the VT100 manual, but I think it's a lot clearer in the [VT220 manual](https://vt100.net/dec/ek-vt220-rm-001.pdf#[{%22num%22%3A70%2C%22gen%22%3A0}%2C{%22name%22%3A%22XYZ%22}%2C0%2C648%2C0]), which lists both control characters and control character glyphs, so you can clearly see the difference. As further confirmation, every Linux terminal emulator I've tested has displayed these code points as glyphs and not interpreted them as control characters. Here is a simple test case: printf "\e(0[b][c][d][e][h][i]\e(B\n" The screenshot below shows the output from XTerm, Gnome Terminal, Konsole, and the Windows console. ![image](https://user-images.githubusercontent.com/4181424/39663472-eb1f6ada-506b-11e8-88bc-68593af5d1ec.png) And note that the two characters that Windows does appear to display (with a replacement char) are still not correct. Those are being mapped to the "form feed" and "vertical tab" control characters, which Windows doesn't implement. If you had a font that supported those glyphs you'd see them as characters \x0C and \x0B (♀ and ♂) from code page 437. * What's wrong / what should be happening instead: When the DEC special graphics character set is enabled, code points \x62 to \x65, \x68, and \x69 should be displayed as glyphs and not interpreted as control characters.
claunia added the Product-ConhostResolution-Fix-Available labels 2026-01-30 21:46:46 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 6, 2018):

Definitely my bad on reading the spec wrong. Good catch!

It took me long enough to find a font that even had those symbols, but fixing the bug was relatively straightforward. In code review now :)

@zadjii-msft commented on GitHub (Jun 6, 2018): Definitely my bad on reading the spec wrong. Good catch! It took me long enough to find a font that even had those symbols, but fixing the bug was relatively straightforward. In code review now :)
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 25, 2018):

Looks like this is fixed in the october 2018 update.

@DHowett-MSFT commented on GitHub (Oct 25, 2018): Looks like this is fixed in the october 2018 update.
Author
Owner

@jerch commented on GitHub (Feb 2, 2020):

@j4james I am not quite sure if the change is the correct behavior - the manual you referred to clearly states, that the graphics set only gets loaded into GR/GL? Which would skip the C0/C1 positions. Also the other charsets listed before in the manual show the control codes as well with kinda the same notation.

Following the parser suggested by VT100.net there seems to be no link between a selected charset and a different behavior/repr of C0 codes. Have not yet checked if DEC STD 070 has something more to tell here. Might have to find out the hard way, not sure if my old vt420 still works...

Woops nvm - thought this is about the C0 char, but its about \x62 to \x65, \x68, and \x69 - so all good.

@jerch commented on GitHub (Feb 2, 2020): ~@j4james I am not quite sure if the change is the correct behavior - the manual you referred to clearly states, that the graphics set only gets loaded into GR/GL? Which would skip the C0/C1 positions. Also the other charsets listed before in the manual show the control codes as well with kinda the same notation.~ ~Following the parser suggested by VT100.net there seems to be no link between a selected charset and a different behavior/repr of C0 codes. Have not yet checked if DEC STD 070 has something more to tell here. Might have to find out the hard way, not sure if my old vt420 still works...~ Woops nvm - thought this is about the C0 char, but its about \x62 to \x65, \x68, and \x69 - so all good.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#247