[PATCH 0/3] vt: make VS16 emoji widening controllable
From: Nicolas Pitre
Date: Mon Oct 19 2026 - 17:20:47 EST
The VT turns a single-width character followed by VS16 (U+FE0F) into a
double-width one, as many terminals do for emoji presentation sequences
such as ‼️. Applications that compute widths with wcwidth() consider
VS16 zero-width though, and those tracking the cursor position
themselves get out of sync. With mosh, a single subject line in an
alpine message index was enough to leave the whole screen scrolled by
one line.
Terminals are split roughly evenly on this, so this series keeps the
current behavior by default and provides a way out:
Patch 1 fixes VS16 widening only taking effect after a double-width
character had been displayed, because the Unicode screen memory it
relies on is allocated on demand.
Patch 2 lets applications control VS16 widening with DEC private mode
2027 (from the Contour terminal's Unicode core proposal), with
vt.default_vs16_wide setting its initial and reset state.
Patch 3 adds DECRQM so applications can query mode states, including
2027, rather than waiting for a reply that never comes.
Tested with a program checking the DECRQM replies for all supported modes,
the VS16 width with the mode set, reset and after RIS, with and without
vt.default_vs16_wide=0, and that other CSI ... $ sequences are still
ignored.
diffstat:
.../admin-guide/kernel-parameters.txt | 10 ++
drivers/tty/vt/vt.c | 114 +++++++++++++++++-
include/linux/console_struct.h | 1 +
3 files changed, 124 insertions(+), 1 deletion(-)
--
2.55.0