Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ncurses attribute A_DIM has no effect

Tags:

ncurses

curses

I am programming in Linux using ncurses. When I use attron() to switch on attributes, it works for all attributes except A_DIM (which is meant to yield half bright characters). A_BOLD, A_ITALIC, A_BLINK, A_UNDERLINE, A_STANDOUT - all of these have effect, but A_DIM has no any visible effect at all, no matter if I use console or xterm. What might be wrong with that?

like image 578
Maximko Avatar asked Dec 15 '25 18:12

Maximko


1 Answers

It depends on the actual terminal, and on the terminal description used. For the latter, you can see immediately if it is provided by looking at the output of infocmp, e.g.,

#   Reconstructed via infocmp from file: /usr/local/ncurses/share/terminfo/x/xterm-new
xterm-new|modern xterm terminal emulator,
    am, bce, km, mc5i, mir, msgr, npc, xenl,
    colors#8, cols#80, it#8, lines#24, pairs#64,
    acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
    bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
    clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
    csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
    cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
    cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,

XTerm provides all of the video attributes (though "dim" and "italics" are relatively recent):

xterm video attributes

Linux console provides some attributes (dim for example), but not underline or italics (it uses color). The usual Linux console terminal description does not include "dim", since that has some caveats:

linux video attributes

These screenshots use the main ncurses test-program, named ncurses (see webpage and source).

like image 69
Thomas Dickey Avatar answered Dec 19 '25 05:12

Thomas Dickey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!