aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-09-27 17:05:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-10-05 14:53:54 +0000
commitfd743b51736e99a097063c1f52c242e5592c298e (patch)
tree42291be9d296bf27a40b200586ea4e92dd898d66 /scripts
parentrender: fix nanosec "overflow" when calculating timeout value (diff)
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-builtin-terminfo.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/generate-builtin-terminfo.py b/scripts/generate-builtin-terminfo.py
index 906e2be0..035fa1cc 100755
--- a/scripts/generate-builtin-terminfo.py
+++ b/scripts/generate-builtin-terminfo.py
@@ -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')