3 ms·
Graphic with escape codes for 256-color terminals (for colorful shell prompts)
- timoteostewart 5y agoThe graphic is a screenshot of the output of the script below. If you run this script in a terminal, then you can copy the escape sequence you want to use and paste it wherever needed. #!/bin/bash for fgbg in 38 48 ; do for color in {0..255} ; do if (( $color < 256 )) ; then padding="" fi if (( $color < 100 )) ; then padding=" " fi if (( $color < 10 )) ; then padding=" " fi printf "\e[${fgbg};5;%sm \\\\e[${fgbg};5;%sm${padding} \e[0m" $color $color if [ $((($color + 1) % 6)) == 4 ] ; then echo "" fi done echo "" done exit 0
- ChrisGranger 5y agoThis works like a charm. Thank you for sharing it.
- deleted 5y ago[deleted]