terminal escape sequence and colors

20/02/2024

Efface depuis le début de la ligne jusqu'au curseur

\033[1K
# exemple
echo -n XXXXX
sleep 1
echo -en "\033[1K\rPULLING"
sleep 1
echo -en "\033[1K\rDONE"
echo

couleurs

echo -en "\033[30m"	Black
echo -en "\033[31m"	Red
echo -en "\033[32m"	Green
echo -en "\033[33m"	Yellow
echo -en "\033[34m"	Blue
echo -en "\033[35m"	Purple
echo -en "\033[36m"	Cyan
echo -en "\033[37m"	White
echo -en "\033[0m"	Reset

Raccourcis