cncursesterminfo

ACS characters not working in putty even with export NCURSES_NO_UTF8_ACS=1


I am developing an ncurses application myself in C. The problem is that putty displays alternative character set characters like ACS_VLINE as letters. My locale is

LANG=en_US.UTF-8

and I have set

export NCURSES_NO_UTF8_ACS=1

I have also set putty to UTF-8 and tried different fonts. The characters display fine on the tty on the actual machine so I think the issue is with putty. I have also tried linking ncursesw instead of ncurses.


Solution

  • It is a combination of things. The recommended TERM for PuTTY is "putty", but due to inertia, most people use "xterm". The line-drawing support in the xterm terminal description is different from PuTTY's assumptions because xterm supports luit, which has some limitations with the way the alternate character set is managed (see Debian Bug report #254316: ncurses-base: workaround for screen's handling of register sgr0 isn't quite right).

    If you use infocmp to compare, you may see these lines which deal with the alternate character set:

        acsc: '``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~', '``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.
        enacs: NULL, '\E(B\E)0'.
        rmacs: '\E(B', '^O'.
        smacs: '\E(0', '^N'.
    

    VT100s can have two character sets "designated", referred to as G0 and G1:

    Although both are VT100-compatible, the xterm scheme does not work with PuTTY. Because of the tie-in with luit, the normal terminal description for xterm will not change (unless it proves possible to modify luit to solve the problem for its users), so a workaround is needed for users of PuTTY:

    Further reading