gpt4 book ai didi

Ncurses 属性 A_DIM 无效

转载 作者:行者123 更新时间:2023-12-04 18:01:37 25 4
gpt4 key购买 nike

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

最佳答案

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

#   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 提供了所有视频属性(尽管“暗淡”和“斜体”是相对较新的):

xterm video attributes

Linux 控制台提供了一些属性(例如暗淡),但没有下划线或斜体(它使用颜色)。通常的 Linux 控制台终端描述不包括“dim”,因为它有一些注意事项:

linux video attributes

这些屏幕截图使用名为 ncurses 的主要 ncurses 测试程序(参见 webpagesource)。

关于Ncurses 属性 A_DIM 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34419186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com