Ncurses 属性 A_DIM 无效 [英] Ncurses attribute A_DIM has no effect

查看:60
本文介绍了Ncurses 属性 A_DIM 无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ncurses 在 Linux 中编程.当我使用 attron() 打开属性时,它适用于除 A_DIM 之外的所有属性(这意味着产生半亮字符).A_BOLD、A_ITALIC、A_BLINK、A_UNDERLINE、A_STANDOUT - 所有这些都有效果,但 A_DIM 根本没有任何可见的效果,无论我使用控制台还是 xterm.这可能有什么问题?

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?

推荐答案

这取决于实际的终端,以及使用的终端描述.对于后者,您可以通过查看 infocmp 的输出立即看到它是否提供,例如,

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 提供了所有的视频属性(虽然dim"和italics"是相对较新的):

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

Linux 控制台提供了一些属性(例如dim),但没有下划线或斜体(它使用颜色).通常的 Linux 控制台终端描述不包括dim",因为它有一些警告:

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:

这些屏幕截图使用名为 ncurses 的主要 ncurses 测试程序(参见 网页来源).

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

这篇关于Ncurses 属性 A_DIM 无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆