-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposed enhancement: ESC sequence to get actual string length #7789
Comments
You can use the existing escape codes to do this in a perfectly
finally retore saved cursor and send escape code to finish atomic |
Thanks for your answer! And what is atomic screen update escape code? Do you mean switching to alternate screen buffer? |
@magiblot, the developer of a modern Turbo Vision implementation with Unicode support, makes a fairly compelling argument as to why the approach of outputting characters and measuring cursor offsets might not be the ideal solution. Let me quote him:
|
Is there any terminal other than iterm2 that supports this? It doesn't work for me in Kitty. |
Most modern terminals support definitely including kitty
…On Sat, Sep 14, 2024 at 01:41:14AM -0700, unxed wrote:
> https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec
Is there any terminal other than iterm2 that supports this? It doesn't work for me in Kitty.
--
Reply to this email directly or view it on GitHub:
#7789 (comment)
You are receiving this because you modified the open/close state.
Message ID: ***@***.***>
--
_____________________________________
Dr. Kovid Goyal
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________
|
One of the major challenges in building console interfaces is the unpredictability of the actual length of a string (in screen cells) when using Unicode characters. The width of the same characters can be displayed differently across various terminals.
Of course, it is possible to determine this width by displaying the characters and checking how much the cursor has moved (sample in python is below), but this approach is slow and clutters the console log.
It would be great if you could propose an additional terminal extension, such as an ESC sequence, that allows querying the terminal to determine how many screen cells a given string of Unicode characters will occupy.
Thank you!
The text was updated successfully, but these errors were encountered: