public
Last active — forked from justinabrahms/colortest.py

Show how different terminals show bold colors

  • Download Gist
simpler
Shell
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh
# Print four lines showing blocks of colors: 0-7 | 0-7bold | 8-15 | 8-15bold
perl -CADS -lwe '
my $block = shift || (chr(0x2588) x 3);
for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) {
my ($bold, $offset) = @$_;
my @range = map $offset + $_, 0..7;
printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]";
print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m"
}
' "$@"
terminals.zsh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/bin/zsh
dir=$0:h
for term_array (
'st true'
'konsole true'
'gnome-terminal false'
'Terminal false'
'terminal false'
'terminator false'
'urxvt-256color true -is +is'
'uxterm true -bdc +bdc')
do
opts=( $=term_array )
term=$opts[1]
array_args=$opts[2]
opts[1,2]=()
(( $#opts )) || opts=( '' )
for opt in "${opts[@]}"
do
shcmd="echo $term $opt ; $dir/simpler ; read"
if $array_args
then
cmd=( sh -c $shcmd )
else
cmd=( "sh -c ${(q)shcmd}" )
fi
tcmd=( $term $opt -e $cmd )
$tcmd &
sleep 0.5
done
done

Modified several more times to match my answer. The results in various terminals:

the results

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.