[X] Fix parsing of ESC % C, which didn't consume the extra character.
[X] Parse ESC / C, which designates G3.
The this._modes.graphic attribute is still updated for backwards compatibility.
Without this, some implementations of ncurses behave incorrectly when $TERM = screen because they set G1 to graphics (\e)0) and after some time perform a SO to select it (\x0E).
Note that the distinction between GL / GR is not implemented yet.
Changes:
TermState
keep track of each character set (G0
,G1
,G2
,G3
) independently, and the active one.SI
andSO
.ESC N O n o
.ESC ( ) * + - .
correctly (also fix parsing in rare cases).ESC % C
, which didn't consume the extra character.ESC / C
, which designatesG3
.The
this._modes.graphic
attribute is still updated for backwards compatibility.Without this, some implementations of ncurses behave incorrectly when
$TERM = screen
because they setG1
to graphics (\e)0
) and after some time perform a SO to select it (\x0E
). Note that the distinction betweenGL
/GR
is not implemented yet.