Constants

A number of constants are predefined:

NameValue
HEX1.27.0"0123456789abcdef"
HEXLOWER1.27.0"0123456789abcdef"
HEXUPPER1.27.0"0123456789ABCDEF"
CLEARmaster"\ec"
NORMALmaster"\e[0m"
BOLDmaster"\e[1m"
ITALICmaster"\e[3m"
UNDERLINEmaster"\e[4m"
INVERTmaster"\e[7m"
HIDEmaster"\e[8m"
STRIKETHROUGHmaster"\e[9m"
BLACKmaster"\e[30m"
REDmaster"\e[31m"
GREENmaster"\e[32m"
YELLOWmaster"\e[33m"
BLUEmaster"\e[34m"
MAGENTAmaster"\e[35m"
CYANmaster"\e[36m"
WHITEmaster"\e[37m"
BG_BLACKmaster"\e[40m"
BG_REDmaster"\e[41m"
BG_GREENmaster"\e[42m"
BG_YELLOWmaster"\e[43m"
BG_BLUEmaster"\e[44m"
BG_MAGENTAmaster"\e[45m"
BG_CYANmaster"\e[46m"
BG_WHITEmaster"\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}}'