I want to make some additions. I faced same issue: many ncurses-based tools like dialog
, menuconfig
and nconfig
from Linux kenrel sources, even mc
is broken when built with ncurses (although mc
is built using Slang on many OSes and not affected).
Here is what happened
ncurses uses smacs
record from terminfo to switch to "alternative charset" and then it uses acsc
to draw boxes. It sends a
which is box-drawing character in alternative charset (ACS).
This is VT100 graphics.
Some terminal emulators nowadays do not support ACS when in UTF-8 because apps have ability to send real box-drawing codepoints.
There is unofficial capability U8
(capital U!) in terminfo
that tells ncurses: "Instead of ACS use real box-drawing codepoints."
I have this capability infocmp -x xterm-utf
and for putty aswell, but not for xterm
.
As you can read in ncurses(3)
(https://invisible-island.net/ncurses/man/ncurses.3x.html), ncurses
is aware of Linux console and GNU screen (and tmux, which also uses screen
as TERM
) and always behave like if U8
were set.
For other terminals that do not support ACS when in UTF, you can set NCURSES_NO_UTF8_ACS
.
Unfortunatelly, ncurses is not aware of putty.
There is also luit
that may convert ACS to Unicode points.
So, here is what we can do to run ncurses + putty in UTF-8:
Use terminal with U8#1
capability. This one is set for putty (btw, I suggest to use putty-256color
instead). You can create your own entry with U8#1
and colors#256
and compile it with tic -x
. Be carefull that mouse may not work on terminals that do not start with xterm
(see mouseinterval(3)
, BUGS section). This is why I do not use putty
terminal. I suggest to copy xterm-utf8
, add colors#256
, compile and stay with it: it works perfectly with putty, mouse and utf8.
You can set NCURSES_NO_UTF8_ACS
in your profile.
You can run screen
or tmux
: it will set TERM
to screen
and fix ncurses
You can run luit
: it will do all convertions for you.
Since putty 0.71 you can ask putty to support ACS drawings even in UTF-8
