作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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 提供了所有视频属性(尽管“暗淡”和“斜体”是相对较新的):
Linux 控制台提供了一些属性(例如暗淡),但没有下划线或斜体(它使用颜色)。通常的 Linux 控制台终端描述不包括“dim”,因为它有一些注意事项:
关于Ncurses 属性 A_DIM 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34419186/
我正在使用 ncurses 在 Linux 中编程。当我使用 attron() 来打开属性时,它适用于除 A_DIM(这意味着产生半亮字符)之外的所有属性。 A_BOLD、A_ITALIC、A_BLI
我是一名优秀的程序员,十分优秀!