From 9128bbc666644db42f210423e7539d1caa1e1f90 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 27 Jul 2019 14:33:57 -0400 Subject: [PATCH] bash: update prompt to be 8-color compatible It's nice to get a colored prompt in the Virtual Console (outside of tmux that is). With TERM=linux, $(tput colors) eq 8, so this commit updates the prompt to only use those 8 colors. --- bash/bash_prompt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bash/bash_prompt b/bash/bash_prompt index 9acd8bc..69852c7 100644 --- a/bash/bash_prompt +++ b/bash/bash_prompt @@ -24,18 +24,18 @@ function get_error_code() { # Preferred Prompt: Fancy with colors from tput if tput setaf 1 &> /dev/null; then tput sgr0 - if [[ $(tput colors) -ge 16 ]] 2>/dev/null; then + if [[ $(tput colors) -ge 8 ]] 2>/dev/null; then SET_PREFERRED_PROMPT=1 RED="\[$(tput setaf 1)\]" MAGENTA="\[$(tput setaf 5)\]" - ORANGE="\[$(tput setaf 11)\]" + YELLOW="\[$(tput setaf 3)\]" GRAY="\[$(tput setaf 8)\]" - BLUE="\[$(tput setaf 12)\]" + BLUE="\[$(tput setaf 4)\]" BOLD="\[$(tput bold)\]" RESET="\[$(tput sgr0)\]" export PS1="$BOLD$RED\$(get_error_code)$BLUE\w $RESET$GRAY${ssh_text}\$(parse_git_branch)"$'\n'"$BOLD$MAGENTA\$ $RESET" - export PS2="$ORANGE> $RESET" + export PS2="$YELLOW> $RESET" fi fi -- libgit2 0.28.4