分页: 1 / 1

fbterm如何显示256色?

发表于 : 2021-02-14 13:04
xukongwen
我的fbterm中启动vim之类的可以显示256色,可是唯独在fbterm下(命令行)只能显示8色,这是啥情况。

我安装了zsh,于是颜色各种不对。

请教诸位大神。

谢谢。

Re: fbterm如何显示256色?

发表于 : 2021-06-02 10:56
astolia
遇事不决看manpage

代码: 全选

man fbterm
256 COLOR EXTENSION

FbTerm supports xterm's 256 color mode extension. The first 16 colors are the default
terminal colors. Additionally, there's a 6x6x6 color cube, and 24 grayscale tones. But
xterm's 256 color escape sequences conflict with the linux sequences implemented by
FbTerm, so private escape sequences were introduced to support this feature:

ESC [ 1 ; n } set foreground color to n (0 - 255)
ESC [ 2 ; n } set background color to n (0 - 255)
ESC [ 3 ; n ; r ; g ; b } set color n to (r, g, b) , n, r, g, b all in (0 -
255)

A new terminfo database entry named "fbterm" was added to use these private sequences, all
program based on terminfo should work with it. By default, FbTerm sets environment
variable "TERM" to value "linux", user need run "TERM=fbterm /path/to/program" to enable
256 color mode.
它支持以特殊的序列来设置颜色。
所以差不多就是用

代码: 全选

echo -en '\e[2;128}'
对于其他的程序需要设置TERM环境变量到fbterm