-
Notifications
You must be signed in to change notification settings - Fork 165
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
viewing binary files breaks output to kitty terminal #2084
Comments
Dub #2068 |
I scrolled through the entire initrd.img and did not reproduce it :)) |
Under kitty? Kovidgoyal's kitty? |
Yes.. But i got it after switching to UTF-8 |
Please note that even with |
@Dazzar56 was planning to look into this. |
Actually, it's several separate issues.
|
This solves problems 1, 2 and 4 for me
|
test1 issues are solved by patch above. test2 in TTY shows "?" in panels after closing viewer (need to have some free space on them; short file list, for example). Not reproduced on latest Mint Cinnamon, reproduces on Ubuntu 23.10. Font and x11 or Wayland does not matter. Also pattern from test2 produce another bug (reproduces in Mint and in wx version also): |
Hypothesis: the bugs remaining after the patch above are due to incorrect calculation of the width of some wide characters. So it manifests itself differently on different systems, because... Unicode libs are different. That is, this is not the output of control characters 0-31, as we thought. Simply invalidating parts of the screen that need redrawing does not seem to work correctly because some characters that should be counted as double width are counted as single width. Or they should have a single width, but are considered to be zero width. But this is only a hypothesis for now. |
If we put the same sequence, say, in php:
we will see:
far2l, apparently, considers this construction to have a width of two characters, and, accordingly, sees no point in invalidating the 3rd one, so it remains on the screen. |
GNOME Terminal and GNOME Text editor also treat GNOME text editor also recognizes this sequence as RTL that is not supported by far2l, see |
Shortest way to reproduce: try this in far2l and in GNOME Terminal:
GNOME shows 2 chars, far2l shows 1 |
Похоже, мы имеем дело со сложным багом, вернее даже тремя:
Может и ещё что-то есть. Это только те причины, которые пока что удалось идентифицировать. |
Another way to reproduce: try to paste this in editor:
|
Fix, works for me. But this why file is generated wrongly?
|
А, не, не всё так идеально. Часть артефактов ушла, но часть осталась. Причем на mint не воспроизводится, а на ubuntu воспроизводится. Есть версия, что такое происходит, когда версия юникода, под которую собрана ICU, которой генерится CharClasses.cpp, отличается от версии, с которой терминал собран, например. Если сделать вообще вот так:
, то артефактов становится ещё меньше, но всё равно часть остаётся. Проверять можно на бинарнике far2l, например: в районе 58-60% проблемы и 62-64%. |
Состояние на сейчас: бипы ушли. Артефакты, увы, остались. Видны справа на бинарнике far2l при включённом wrap'е (с самого начала файла, и вниз-вверх несколько экранов пролистать), но тут влиять размер окна может, надо пробовать на разных. #2107 проблему решает, хотя я и не уверен, что идеалогически правильно использовать wcwidth() для дополнительной проверки. Это просто то, что было найдено эмпирически, и в паре с обновлением CharClasses.cpp на последней Убунте сработало на практике. |
На самом деле там артифакты даже с этим фиксом есть, просто меньше гораздо. Эту тему ещё поизучать предстоит более пристально. Хотел инструментов для тестирования дождаться спрева, прежде чем трогать, чтоб не сломать что-нибудь случайно. |
По оставшемуся — вот: |
Noticed here:
And here:
Kitty has this behavior documented and suggests using
cat -v
for binary data:mc does not have this bug, it just replaces all control codes with
.
char.How to reproduce?
sudo apt install kitty
kitty
far2l --tty
in kittyinitrd.img
Down
keyThe text was updated successfully, but these errors were encountered: