set_color [OPTIONS] VALUE
set_color is used to control the color and styling of text in the terminal. VALUE describes that styling. VALUE can be a reserved color name like red or an RGB color value given as 3 or 6 hexadecimal digits (“F27” or “FF2277”). A special keyword normal resets text formatting to terminal defaults.
Valid colors include:
The br- (as in ‘bright’) forms are full-brightness variants of the 8 standard-brightness colors on many terminals. brblack has higher brightness than black - towards gray.
An RGB value with three or six hex digits, such as A0FF33 or f2f can be used. A three digit value is equivalent to specifying each digit twice; e.g., set_color 2BC is the same as set_color 22BBCC. Hexadecimal RGB values can be in lower or uppercase.
If fish_term24bit is set to 0, fish will translate RGB values to the nearest color on the 256-color palette. If fish_term256 is also set to 0, fish will translate them to the 16-color palette instead. Fish launched as fish -d term_support will include diagnostic messages that indicate the color support mode in use.
If multiple colors are specified, fish prefers the first RGB one. However if fish_term256 is set to 0, fish prefers the first named color specified.
The following options are available:
Sets the background color.
Set the underline color.
Prints the given colors or a colored list of the 16 named colors.
Sets bold mode.
Sets dim mode.
Sets italics mode.
Sets reverse mode.
Sets strikethrough mode.
Set the underline mode; supported styles are single (default), double, curly, dotted and dashed.
Ignored. Color variables that contain only this option are treated like missing / empty color variables, i.e. fish will use the fallback color instead. fish_config theme choose erases all color variable whose value includes this option, and adds this option to all color variables it sets. This allows identifying variables set by a theme, and it allows fish to update color variables whenever fish_terminal_color_theme changes.
Displays help about using this command.
--bold escape sequence to switch to a brighter color set rather than increasing the weight of text.set_color works by printing sequences of characters to standard output. If used in command substitution or a pipe, these characters will also be captured. This may or may not be desirable. Checking the exit status of isatty stdout before using set_color can be useful to decide not to colorize output in a script.set_color red; echo "Roses are red" set_color blue; echo "Violets are blue" set_color 62A; echo "Eggplants are dark purple" set_color normal; echo "Normal is nice" # Resets the background too
© 2005-2009 Axel Liljencrantz, 2009-2026 fish-shell contributors
Licensed under the GNU General Public License, version 2.
https://fishshell.com/docs/4.5/cmds/set_color.html