diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d5b7be..1606f3b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,8 @@ (e.g. KDE/plasma). * Nanosecs "overflow" when calculating timeout value for `resize-delay-ms` option. +* Missing backslash in ST terminator in escape sequences in the + built-in terminfo (accessed via XTGETTCAP). [1173]: https://codeberg.org/dnkl/foot/issues/1173 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')