Add a table of all possible SGR commands

This commit is contained in:
The Magician 2023-11-07 12:17:41 +00:00
parent 9467c031d6
commit f035e509fa
1 changed files with 16 additions and 1 deletions

View File

@ -394,7 +394,22 @@ section_using_escape_sequences_in_shell_prompt() {
section_table_of_all_sgr_commands() {
title "Table of All SGR Commands"
printf 'TODO\n'
printf "Below is a table of all possible SGR parameters, from 0 to 107, so you can see which ones have support in your terminal.\n"
newline
for i in $(seq 0 107); do
if test "$(echo $i % 10 | bc)" = "0" -a "$i" != "0"; then
printf "\n"
fi
printf "\e[${i}m\\\e[%dm\e[0m" "$i"
if test "$i" -lt "10"; then printf " "; fi
if test "$i" -lt "100"; then printf " "; fi
printf " "
done
newline
}
section_credits() {