ANSI Color Specific RGB Sequence Bash

前端 未结 5 1662
孤街浪徒
孤街浪徒 2020-12-04 08:56

I know that in bash terminals a reliable way to change color is using ANSI escape sequences. For example:

echo -e \"\\033[0;31mbrown text\\033[0;00m\"
         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 09:16

    Currently true color escape sequences (\e[38;2;R;G;Bm) are supported by certain terminal emulators including gnome-terminal (with vte >= 0.36), konsole, and st [suckless].

    The feature is not supported by certain others, e.g. pterm [putty], terminology [enlightenment], urxvt.

    xterm is halfway in between: it recognizes the escape sequences, but rounds every color to the nearest one in the 256-color palette.

提交回复
热议问题