Constants
A number of constants are predefined:
| Name | Value | Value on Windows |
|---|---|---|
HEX1.27.0 | "0123456789abcdef" | |
HEXLOWER1.27.0 | "0123456789abcdef" | |
HEXUPPER1.27.0 | "0123456789ABCDEF" | |
PATH_SEP1.41.0 | "/" | "\" |
PATH_VAR_SEP1.41.0 | ":" | ";" |
CLEAR1.37.0 | "\ec" | |
NORMAL1.37.0 | "\e[0m" | |
BOLD1.37.0 | "\e[1m" | |
ITALIC1.37.0 | "\e[3m" | |
UNDERLINE1.37.0 | "\e[4m" | |
INVERT1.37.0 | "\e[7m" | |
HIDE1.37.0 | "\e[8m" | |
STRIKETHROUGH1.37.0 | "\e[9m" | |
BLACK1.37.0 | "\e[30m" | |
RED1.37.0 | "\e[31m" | |
GREEN1.37.0 | "\e[32m" | |
YELLOW1.37.0 | "\e[33m" | |
BLUE1.37.0 | "\e[34m" | |
MAGENTA1.37.0 | "\e[35m" | |
CYAN1.37.0 | "\e[36m" | |
WHITE1.37.0 | "\e[37m" | |
BG_BLACK1.37.0 | "\e[40m" | |
BG_RED1.37.0 | "\e[41m" | |
BG_GREEN1.37.0 | "\e[42m" | |
BG_YELLOW1.37.0 | "\e[43m" | |
BG_BLUE1.37.0 | "\e[44m" | |
BG_MAGENTA1.37.0 | "\e[45m" | |
BG_CYAN1.37.0 | "\e[46m" | |
BG_WHITE1.37.0 | "\e[47m" |
@foo:
echo {{HEX}}
$ just foo
0123456789abcdef
Constants starting with \e are
ANSI escape sequences.
CLEAR clears the screen, similar to the clear command. The rest are of the
form \e[Nm, where N is an integer, and set terminal display attributes.
Terminal display attribute escape sequences can be combined, for example text
weight BOLD, text style STRIKETHROUGH, foreground color CYAN, and
background color BG_BLUE. They should be followed by NORMAL, to reset the
terminal back to normal.
Escape sequences should be quoted, since [ is treated as a special character
by some shells.
@foo:
echo '{{BOLD + STRIKETHROUGH + CYAN + BG_BLUE}}Hi!{{NORMAL}}'