-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Right-to-Left text displayed in incorrect column #1392
Comments
Thanks so much for this detailed bug report, @dotancohen. I committed a potential fix which wraps all text with FSI/PDI as per Unicode TR9: Bidirectional Algorithm. Let's try this on all manner of terminals and see if it works for RTL text, and make sure it doesn't regress anything on weaker platforms (looking at you, Windows Terminal). |
I believe this is more a konsole bug than a visidata bug. As a workaround (assuming you use UTF-8 terminal): In visidata config file change
The line character is U+2502, not ascii 0x7c. You can use any character from this unicode block. Make sure "Use line characters contained in font" (in profile::Appearance) is unchecked. |
@MatanZ I think your solution is actually the better one. FSI/PDI corrupts the display on at least xterm and Windows, while using characters from the U+25xx block seems to do the better thing in nearly all cases. I have a preference for using the basic ASCII |
Thank you for the suggestion. In fact, just configuring the U+2502 did not resolve the issue for me, so as stated perhaps it is a Konsole / KDE issue. However, setting the separator as
|
@MatanZ does the recent change to U+2502 fix all RTL issues in cells for you? |
Yes. With the latest git it works displays correctly in konsole 22.04.1 (Fedora 36). But note that in Unicode those characters are defined as neutral bidi class, so this fix will not work in terminals that implement the Unicode algorithm for bidi (which konsole does not). I hope that konsole 22.12 will have a more standard compliant bidi rendering, but it will override those characters to strong LTR, so there won't be a problem. |
Hm, I'm wondering if there really is any 'general' solution, or if we have to do something different for RTL on each terminal. Or recommend a terminal on each platform that just works for RTL/bidi--which terminal is "best" from this standpoint? |
Given the following CSV file:
The expected output would have the text
שלום עולם
underhello world
, would haveשתה בירה!
under "dring beer!, and would have
תאהב אנשים.under
love people`.However, this is the display with the cursor on the first column:
![Screenshot_20220606_095658](https://user-images.githubusercontent.com/246144/172111139-fdf0d9c4-6cab-4fab-bbc0-91c90e0912c1.png)
This is the display with the cursor on the second column:
![Screenshot_20220606_095730](https://user-images.githubusercontent.com/246144/172111211-3e92e706-7c54-4bf7-8d47-719d5a1859c8.png)
And this is the display with the cursor on the third column:
![Screenshot_20220606_095805](https://user-images.githubusercontent.com/246144/172111282-1cf7c084-dbfd-44b8-939c-f7fe95c06998.png)
It seems that the directionality is not reset between cells, so consecutive Right-to-Left cells are displayed from right to left instead of the expected left to right.
This is on Kubuntu 20.04 with Konsole 19.12.3 on KDE 5.18.8.
The text was updated successfully, but these errors were encountered: