Terminal software identity-assisted wcswidth()#220
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #220 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 23 27 +4
Lines 1570 1924 +354
Branches 390 456 +66
==========================================
+ Hits 1570 1924 +354 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 13.5%
|
|
I forgot to include language grapheme overrides, which is arguably the most useful -- but there is a lot of difficulty in doing this correctly, |
- Resolve conflicts in _wcswidth.py and _width.py: keep dynawidth changes - Combine 0.8.0 changelog entries in docs/intro.rst
after a lot of consideration, mainly due to possibility of breaking downstream automatic tests -- and broken in sometimes unpredictable ways, even though automatic terminal identification would improve most user experience, it is now False by default, for safety. I do very much still recommend XTVERSION and ENQ, I might work with downstream dependencies like urwid.
leave wcswidth() as-is and make new wcstwidth() for logic containing terminal-aware overrides, this should remove any performance loss for the pre-0.8.0 use case of not specifying any 'term_program=True|str'
VS-15 narrows width
Correction Tables
disabled by default (
term_program=False),term_program=True, that they benefit when unique identifyingTERMorTERM_PROGRAMUse environment values of
TERM_PROGRAMandTERM, and suggest that calling programs to useXTVERSIONorENQquery result, to hint towidth()and similar forwcswidth(term_program='xterm.js'),Correction tables for ~20+ modern terminals, ~14 unique fingerprints, shared by hashing:
And their aliases: hyper, iterm.app, putty, rxvt, rxvt-unicode-256color, screen, st-256color, tabby, tmux-256color, vscode, warpterminal, xterm-ghostty, xterm-kitty.
Closes #211.