From 42efe7dad61414c4554cc970e2dbe91c6172d832 Mon Sep 17 00:00:00 2001 From: leerobertdyer Date: Fri, 9 Aug 2024 16:11:20 -0400 Subject: [PATCH 1/2] bug(bare): address possible hard to read text colors --- bare | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bare b/bare index b95ad31..f4fb72b 100755 --- a/bare +++ b/bare @@ -64,12 +64,12 @@ case $1 in # mostly for Macs running zsh by default export BASH_SILENCE_DEPRECATION_WARNING=1 - GREEN='\\033[0;32m' - YELLOW='\\033[0;33m' - GRAY='\\033[2;37m' + GREEN='\\033[40;32m' + YELLOW='\\033[40;33m' + GRAY='\\033[40;37m' RESET='\\033[0m' - PS1="🐻 \[\${GREEN}\]\$(basename \$(pwd)) \[\${YELLOW}\]> \[\${RESET}\]" + PS1="\[\${GREEN}\] 🐻 \$(basename \$(pwd)) \[\${YELLOW}\]> \[\${RESET}\]" printf "\n\${GRAY}entering bare terminal. type exit when ready to leave.\${RESET}\n" From 9be3f62c97869b22bcd01421e90f73d9f471df66 Mon Sep 17 00:00:00 2001 From: leerobertdyer Date: Fri, 9 Aug 2024 22:15:48 -0400 Subject: [PATCH 2/2] feat(openai): update UX to differentiate between chat response and terminal text --- bare | 8 ++++---- openai | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bare b/bare index f4fb72b..b95ad31 100755 --- a/bare +++ b/bare @@ -64,12 +64,12 @@ case $1 in # mostly for Macs running zsh by default export BASH_SILENCE_DEPRECATION_WARNING=1 - GREEN='\\033[40;32m' - YELLOW='\\033[40;33m' - GRAY='\\033[40;37m' + GREEN='\\033[0;32m' + YELLOW='\\033[0;33m' + GRAY='\\033[2;37m' RESET='\\033[0m' - PS1="\[\${GREEN}\] 🐻 \$(basename \$(pwd)) \[\${YELLOW}\]> \[\${RESET}\]" + PS1="🐻 \[\${GREEN}\]\$(basename \$(pwd)) \[\${YELLOW}\]> \[\${RESET}\]" printf "\n\${GRAY}entering bare terminal. type exit when ready to leave.\${RESET}\n" diff --git a/openai b/openai index 37fd7eb..b3053a8 100755 --- a/openai +++ b/openai @@ -140,7 +140,15 @@ case "$1" in recins -t ThreadMessage .var/bare.rec -f Thread -v "$thread_title" -f Author -v "${assistant_name-Assistant}" -f Contents -v "$response" } - echo "$response" + GRAY='\033[40;37m' + RESET='\033[0m' + + # Pipe the response through a sed to replace each new line start with a tab + formatted_response=$(echo "$response" | sed 's/^/\t/') + + echo -e "${GRAY}\n\n$formatted_response" + echo -e "${RESET}\n" + ;;