martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.
MIT License
857 stars 106 forks source link

Garbled text (when rendering thai?) #53

Open ghost opened 7 years ago

ghost commented 7 years ago

To reproduce: https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt $ (printf "\033]0;moo\007"; mcview ~/x/txt/UTF-8-demo.txt) in one terminal running dvtm' and xdotool search --name moo key slash t h a i Return sleep 1 key Up F7' somewhere else.

ghost commented 7 years ago

I could reproduce in dvtm (in st) with TERM=xterm DVTM_TERM=dvtm dvtm -c mcview <path>/UTF-8.demo.txt, but I did not have any issue with less (neither of gnu or busybox one).

Maybe you can try any other pager to review thai in the meantime, even if this does not fix the issue.

ghost commented 7 years ago

Josuah Demangeon⠠⠵ notifications@github.com writes:

I could reproduce in dvtm (in st) with TERM=xterm DVTM_TERM=dvtm dvtm -c mcview <path>/UTF-8.demo.txt, but I did not have any issue with less (neither of gnu or busybox one).

Maybe you can try any other pager to review thai in the meantime, even if this does not fix the issue.

I don't read/know Thai either so can definitely live without it, that said the bug was filled because something is clearly wrong and underlying bug can have other (perhaps malicious) manifestations.

-- mailto:moosotc@gmail.com

ghost commented 7 years ago

Josuah Demangeon⠠⠵ notifications@github.com writes:

I could reproduce in dvtm (in st) with TERM=xterm DVTM_TERM=dvtm dvtm -c mcview <path>/UTF-8.demo.txt, but I did not have any issue with less (neither of gnu or busybox one).

Maybe you can try any other pager to review thai in the meantime, even if this does not fix the issue.

Simpler reproducer that doesn't require Thai or xdotool for that matter. Simple diacritics suffice.

$ (printf "\x65\xcc\x81" >/tmp/dia; mcview /tmp/dia; rm /tmp/dia)

In my setup there's a black rectangle on the right side with dvtm and no rectangle with plain st.

-- mailto:moosotc@gmail.com

ghost commented 7 years ago

moosotc@gmail.com writes:

Josuah Demangeon⠠⠵ notifications@github.com writes:

I could reproduce in dvtm (in st) with TERM=xterm DVTM_TERM=dvtm dvtm -c mcview <path>/UTF-8.demo.txt, but I did not have any issue with less (neither of gnu or busybox one).

Maybe you can try any other pager to review thai in the meantime, even if this does not fix the issue.

Simpler reproducer that doesn't require Thai or xdotool for that matter. Simple diacritics suffice.

$ (printf "\x65\xcc\x81" >/tmp/dia; mcview /tmp/dia; rm /tmp/dia)

In my setup there's a black rectangle on the right side with dvtm and no rectangle with plain st.

nano can be used instead of mcview, after `nano /tmp/dia' the help bar (at least) is shifted one character to the right

-- mailto:moosotc@gmail.com

ghost commented 7 years ago

LC_CTYPE in my environment equals ru_RU.utf8, this, eventually, results in nl_langinfo(CODESET) returning ANSI_X3.4-1968 and dvtm (via is_utf8_locale(void)) assuming that locale isn't utf8.

ghost commented 7 years ago

Upon further reflection it appears that the problem is not within dtvm but st (AFAICS it does nothing to handle combining characters). Sorry for the noise. And FWIW this LC_CTYPE thing was complete red-herring.