This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux-10-quiet-head
in repository terminology.
View the commit online.
commit 1c388d0e30f726df161da1e298a7818c3c517944
Author: Boris Faure <[email protected]>
AuthorDate: Thu Nov 5 20:39:48 2026 +0000
termptyesc: cancel a DCS on CAN and SUB
A DCS ignored CAN and SUB, so a cancelled DCS went on swallowing the
output after it until an ST came. CSI, OSC and APC already stop on
them, as DEC STD 070 3.5.4.4 requires.
---
src/bin/termptyesc.c | 3 +++
tests/dcs-cancel.sh | 21 +++++++++++++++++++++
tests/tests.results | 1 +
3 files changed, 25 insertions(+)
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 0a454f3d..73b8a4e0 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -5952,6 +5952,9 @@ _handle_esc_dcs(Termpty *ty,
be = buf + sizeof(buf) / sizeof(buf[0]);
while ((cc < ce) && (*cc != ST) && (b < be))
{
+ /* As in xterm, CAN and SUB cancel the string */
+ if ((*cc == CAN) || (*cc == SUB))
+ return cc + 1 - c;
if ((cc < ce - 1) &&
(((*cc == ESC) && (*(cc + 1) == '\\')) ||
(*cc == ST)))
diff --git a/tests/dcs-cancel.sh b/tests/dcs-cancel.sh
new file mode 100644
index 00000000..681cfc0e
--- /dev/null
+++ b/tests/dcs-cancel.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
+
+# clear screen
+printf '\033[2J'
+
+# move to 0; 0
+printf '\033[0;0H'
+
+# CAN cancels a DCS, the text after it shows
+printf '\033Pqabc\030A'
+
+# so does SUB
+printf '\033P$qm\032B'
+
+# a cancelled DECRQSS is not answered, the next sequence is parsed
+printf '\033P$qm\030\033[32mC'
+
+# CAN right after the introducer
+printf '\033P\030D'
diff --git a/tests/tests.results b/tests/tests.results
index c0f2c3d7..39aaee90 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -203,3 +203,4 @@ decset-2031.sh 60c4f2ca88a2a4dbae8f7453c633d074
ascii_run_prefix.sh 5413bed756d01dc51d09609c8512b8ec
xtgettcap.sh 300a0521bca0f2bf50bc00161f8fc195
crash_cup_col_over_margin.sh 400a5215c6e74782cbab076e2a81fff7
+dcs-cancel.sh 5802db97bcbf6f2ab0d8e49723fcfea8
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.