mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
scripts: generate-builtin-terminfo: double-escape backslash in ST
Fixes an issue with XTGETTCAP, where escape sequences terminated with ST, and containing parameters were missing a trailing backslash.
This commit is contained in:
parent
37218be648
commit
fd743b5173
2 changed files with 6 additions and 0 deletions
|
|
@ -55,6 +55,10 @@ class StringCapability(Capability):
|
|||
value = re.sub(r'\\E([0-7])', r'\\033" "\1', value)
|
||||
value = re.sub(r'\\E', r'\\033', value)
|
||||
else:
|
||||
# Need to double-escape backslashes. These only occur in
|
||||
# ‘\E\’ combos. Note that \E itself is updated below
|
||||
value = value.replace('\\E\\\\', '\\E\\\\\\\\')
|
||||
|
||||
# Need to double-escape \E in C string literals
|
||||
value = value.replace('\\E', '\\\\E')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue