g3t0r
g3t0r

Reputation: 13

How to make ACS variables display on terminal

Is there any way to force displaying ACS variables from ncurses in terminal? On urxvt and text-mode everything displays well, but on other terminals (i tested on xfce4-terminal, xterm, gnome-terminal)there is always is problem. I tought I can do nothing with this, but I saw that in alsamixer everything displays properly. I loop up for this in alsamixer code and saw they are using exacly same method to display this characters, for examle

addch(ACS_RARROW);

is giving them this result while same command gives me this on same terminal.

Upvotes: 0

Views: 130

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54563

On a terminal where your locale says to use UTF-8 (you can see this by the naming convention of values shown by the locale command), you must do this:

  • compile/link with ncursesw
  • initialize the locale before initscr, e.g.,

    setlocale(LC_ALL, "");

See the Initialization section of the ncurses manual, as well as the Line Graphics section of the addch manual page.

Upvotes: 0

Related Questions