Replies: 2 comments
-
Measurement ViabilityThis branch shows that full Unicode support is possible, but that doesn't mean it's currently viable. Right now the demo depends on preset tables that were measured offline. In practice xterm.js would need to measure during a live session -- not the full Unicode space, but some runtime probing would still be required, which raises real questions: how to avoid corrupting user input? whether to fork a shadow process? how to detect app switches? And what about apps that cannot be measured at all? jerch pointed out there is no negotiated Unicode protocol. Measuring was effectively a way to re-derive one, but after looking at what it would take to integrate live measurement cleanly, I think the problem may be intractable unless there is a cleaner way to approach live measurement? Salvageable PiecesEven if live measurement is not practical, there are pieces here that still seem useful.
Breaking Out of Unicode HellIt is a curious situation. Apps expect terminals to mirror their implicit column layout without communicating what that layout actually is. Terminals gravitate toward a common denominator, and coordination deadlock ensues where neither side can update without breaking the implied contract. A Unicode protocol could help, but it raises a deeper question: why are two coordinated systems doing the same width computation at all? This seems like a problem of misattributed responsibility where the conventional wisdom that terminals should remain forever dumb has led to a broken system. Width is fundamentally a rendering concern. My conclusion is that visual representation should be owned by the terminal, not the app. One possible migration path would build on Kovid Goyal's text sizing protocol (RFC: kovidgoyal/kitty#8226). With a negotiated capability flag, apps would send |
Beta Was this translation helpful? Give feedback.
-
|
hey, did anyone get a chance to play around with this? i'm curious whether it worked for others or whether this feels worth pursuing. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
branch: https://github.com/koal44/xterm.js/tree/poc/unicode-hell
run the demo, enable the compat-addon in the width tab, and try your usual unicode test cases in bash/zsh/fish/pwsh. it renders modern unicode grapheme clusters over a legacy wcwidth-style model while remaining in sync with the backend app and supporting atomic cursor movement and deletion.
Beta Was this translation helpful? Give feedback.
All reactions