reset terminfo: add an empty OSC sequence to rs1 string

In OSC/OTH mode, the parser accumulate bytes until it fills up or
encounters some end-of-osc sequence.
After entering in either of these mode by mistake, for example by
displaying random bytes (e.g. cat a binary) nothing would print anymore
but input would still work.

In that situation, being able to hit `reset` and recover a usable
terminal helps.

You can try with `echo -e '\xc2\x9e'` for PM
This commit is contained in:
Dominique Martinet 2018-09-19 13:33:25 +09:00
parent 60de840d69
commit 07a4cec616
4 changed files with 3 additions and 3 deletions

View File

@ -227,8 +227,8 @@ string_capabilities = {
'rmso': r'\E[27m',
# Exit underline mode
'rmul': r'\E[24m',
# Reset string1
'rs1': r'\Ec',
# Reset string1 (empty OSC sequence to exit OSC/OTH modes, and regular reset)
'rs1': r'\E]\E\\\Ec',
# Save cursor
'sc': r'\E7',
# Set background color

Binary file not shown.

View File

@ -121,7 +121,7 @@ xterm-kitty|KovIdTTY,
rmkx=\E[?1l,
rmso=\E[27m,
rmul=\E[24m,
rs1=\Ec,
rs1=\E]\E\\\Ec,
sc=\E7,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,

Binary file not shown.