This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository terminology.

View the commit online.

commit e219a3900047819c1c836c700b43f01d5263373b
Author: Boris Faure <[email protected]>
AuthorDate: Sun Nov 29 14:30:48 2026 +0000

    termptyesc: accept DECSET 2027 as permanently reset
    
    DECSET 2027 asks the terminal to treat a grapheme cluster as one unit
    of width, per Contour's terminal-unicode-core proposal
    (https://github.com/contour-terminal/terminal-unicode-core). A Termcell
    holds a single codepoint, so Terminology cannot honour it: accept the
    mode as a quiet no-op instead of logging an unhandled-mode warning and
    setting decoding_error, which makes normal builds echo the sequence on
    stdout (Codex/opentui send it at startup).
    
    DECRQM already answers 4 (permanently reset) from the table, and 4 is
    the right answer rather than 2: opentui reads 2027;2$y as support and
    would then send CSI ? 2027 h expecting cluster widths, mis-measuring
    every emoji sequence. 4 keeps it on the per-codepoint wcwidth() path,
    which is what Terminology does. The screen does not change; the new
    test only locks in the ?2027;4$y replies and the per-codepoint width
    of a ZWJ sequence.
---
 src/bin/termptyesc.c |  6 ++++++
 tests/decset-2027.sh | 11 +++++++++++
 tests/tests.results  |  1 +
 3 files changed, 18 insertions(+)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 3428bdcd..24b5e15a 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -737,6 +737,12 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b,
                    else
                      _sync_output_end(ty);
                    break;
+                case 2027: /* grapheme cluster processing (Contour's
+                           * terminal-unicode-core): not implemented, cells
+                           * hold one codepoint each. DECRQM reports 4. */
+                   DBG("grapheme cluster mode %i ignored: not supported",
+                       mode);
+                   break;
                 case 2031: /* colour scheme change reporting */
                    ty->color_scheme_reporting = mode;
                    break;
diff --git a/tests/decset-2027.sh b/tests/decset-2027.sh
new file mode 100755
index 00000000..2ad52f91
--- /dev/null
+++ b/tests/decset-2027.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
+
+printf '\033[?2027\044p'
+printf '\033[?2027h'
+printf '\033[?2027\044p'
+# a ZWJ sequence still takes its per-codepoint widths
+printf '\360\237\221\250\342\200\215\360\237\221\251\n'
+printf '\033[?2027l'
+printf '\033[?2027\044p'
diff --git a/tests/tests.results b/tests/tests.results
index 2dc2cb63..dd9a5141 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -209,6 +209,7 @@ osc52_selector_full_buffer.sh 1ef32e63c430e26c33788cc4e40e58d7
 osc52_long.sh e9a6f4e0ea7bb6fbdaba74988d88b67c
 osc-can.sh 74530a1ced8bc249989e9175c8d29e99
 dsr-color-scheme.sh 68f86326864cc9988c84dc20babe4156
+decset-2027.sh 0a1c82f8293b216ac59148326b539079
 decset-2031.sh 60c4f2ca88a2a4dbae8f7453c633d074
 ascii_run_prefix.sh 5413bed756d01dc51d09609c8512b8ec
 xtgettcap.sh 300a0521bca0f2bf50bc00161f8fc195

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to