Skip to content

Instantly share code, notes, and snippets.

@alsunseri
Created May 3, 2022 01:41
Show Gist options
  • Save alsunseri/59e87d37dfd27c7210679e131651af30 to your computer and use it in GitHub Desktop.
Save alsunseri/59e87d37dfd27c7210679e131651af30 to your computer and use it in GitHub Desktop.
Bourne or bash terminal see/display text in all 256 colors
#!/bin/sh
# if your TERM is not set to *-256color or the like then run this:
# export TERM=xterm-256color
i=0
while [ $i -ne 255 ]
do
i=$(($i+1))
tput setaf $i && echo -n "setaf $i in color tags "
tput setaf $i | xxd
done
# note - this will only change fg text colors
# it does not explore underlines, background color or 'bold'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment