-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Support BiDirectional text #1665
Comments
I know the problem, but not being any of RTL language speaker, it's hard to read and understand proper outline and direction. It would help a lot, if you may create reliable test and the screenshots of expected and wrong output. Also, it's not clear to me, what is expected behavior on English text containing parts of RTL. |
OK, will do. |
It seems that the way unicode describes bidirectional text printing characters in correct order requires knowing full text (chunk of text) in advance. That is not really practical for terminal. Printing characters incrementally can change positions of previously printed characters. From the look of https://www.arabeyes.org/ArabeyesTodo#Terminal_Emulators no one really knows how bidirectional text should interact with various terminal control characters like moving/reading cursor position, clearing until end of line and others. What happens you replace character in the middle of previously printed text? |
Exactly. |
Turns out ECMA-48 standard has a little bit of information about how bi-directional text should interact with terminal control sequences. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf |
bidirectional console (BiCon) might be relevant here |
Just an update - new console BiDi specification was recently implemented in libvte by @egmontkob: https://terminal-wg.pages.freedesktop.org/bidi/implementations.html#vte See also the issue in the new Windows Terminal microsoft/terminal#538 |
Thank you for this project. It's specially nice that it can properly render Arabic words. (when I say Arabic it also applies to Persian, Urdu and other languages that use Arabic script) If one or more Arabic words or phrases have a different color, or uses any ANSI formatting, the order of words in that paragraph become messed up. I suggest you try to disable existing RTL support if any formatting exists in a paragraph, so words are shown left to right, just like Git Bash/Mintty or windows You can use Python to reproduce: (and compare it with Git Bash) >>> red = f"\x1b[38;5;1m"
>>> reset = "\x1b[0;0;0m"
>>> words = [f"کلمه{i+1}" for i in range(3)]
>>> print(" ".join(words))
>>> print(words[0] + " " + red + words[1] + reset + " " + words[2]) You can see both ConEmu and Git Bash (Mintty) here: |
https://gist.github.com/XVilka/a0e49e1c65370ba11c17
Related to https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/34937857-bidirectional-text-support
The text was updated successfully, but these errors were encountered: