我的fbterm中启动vim之类的可以显示256色,可是唯独在fbterm下(命令行)只能显示8色,这是啥情况。
我安装了zsh,于是颜色各种不对。
请教诸位大神。
谢谢。
fbterm如何显示256色?
- xukongwen
- 帖子: 21
- 注册时间: 2021-01-19 16:24
- astolia
- 论坛版主
- 帖子: 6483
- 注册时间: 2008-09-18 13:11
Re: fbterm如何显示256色?
遇事不决看manpage
所以差不多就是用
对于其他的程序需要设置TERM环境变量到fbterm
代码: 全选
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}'