Constants
A number of constants are predefined:
Name | Value |
---|---|
HEX 1.27.0 | "0123456789abcdef" |
HEXLOWER 1.27.0 | "0123456789abcdef" |
HEXUPPER 1.27.0 | "0123456789ABCDEF" |
CLEAR master | "\ec" |
NORMAL master | "\e[0m" |
BOLD master | "\e[1m" |
ITALIC master | "\e[3m" |
UNDERLINE master | "\e[4m" |
INVERT master | "\e[7m" |
HIDE master | "\e[8m" |
STRIKETHROUGH master | "\e[9m" |
BLACK master | "\e[30m" |
RED master | "\e[31m" |
GREEN master | "\e[32m" |
YELLOW master | "\e[33m" |
BLUE master | "\e[34m" |
MAGENTA master | "\e[35m" |
CYAN master | "\e[36m" |
WHITE master | "\e[37m" |
BG_BLACK master | "\e[40m" |
BG_RED master | "\e[41m" |
BG_GREEN master | "\e[42m" |
BG_YELLOW master | "\e[43m" |
BG_BLUE master | "\e[44m" |
BG_MAGENTA master | "\e[45m" |
BG_CYAN master | "\e[46m" |
BG_WHITE master | "\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}}'