From f035e509facff66126d6a0b4df3f9298352a2d11 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 7 Nov 2023 12:17:41 +0000 Subject: [PATCH] Add a table of all possible SGR commands --- thebookofcolors | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/thebookofcolors b/thebookofcolors index 170b9e2..13e79f1 100755 --- a/thebookofcolors +++ b/thebookofcolors @@ -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() {