From 347951cbdf3362ddb85849b2a9c1fa3ef4a21d67 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 16 Nov 2024 01:54:13 +0100 Subject: [PATCH] wip/shell_color --- shell/shell.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shell/shell.sh b/shell/shell.sh index 82a1ed2..e164562 100644 --- a/shell/shell.sh +++ b/shell/shell.sh @@ -1,5 +1,16 @@ SH="$(cat /proc/$$/comm)" +shell_color() { + local code="${1}" + if [ -n "${code}" ]; then + case "${SH}" in + "bash") printf "\e[0;" ;; + *) printf "\033[" ;; + esac + printf "%s" "${code}m" + fi +} + case "${SH}" in "bash") # completion