vt: make VS16 emoji widening controllable
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | vt: don't make VS16 widening depend on earlier screen contentsdrivers/ | +9 | 0 replies | |
| 2/3 | vt: add DEC private mode 2027 to control VS16 wideningDocumentation/ drivers/ include/ | +25 | 0 replies | |
| 3/3 | vt: add DECRQM support to report mode statesdrivers/ | +90 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] vt: make VS16 emoji widening controllable
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(-)
Signature · 1 line
2.55.0