From 7f435c1a60ddcdbd5459c04aace1bd021610660e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 13 Mar 2022 05:36:45 +0000 Subject: Change prompt --- bash/prompt.bash | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'bash/prompt.bash') diff --git a/bash/prompt.bash b/bash/prompt.bash index df30c82..02d9c98 100644 --- a/bash/prompt.bash +++ b/bash/prompt.bash @@ -4,22 +4,25 @@ PS1= # user, host, and cwd PROMPT_DIRTRIM=3 # how many dirs above current to print (rest are '...') -PS1+='\[\e[36m\]\u@\h \w' +PS1+='\[\e[34m\]# \u@\h \w' # git bit # see https://unix.stackexchange.com/questions/278206 possible_git_prompt_locations=( - /usr/share/git/git-prompt.sh # Arch, etc. (default?) - /usr/lib/git-core/git-sh-prompt # Debian, Ubuntu ... - /usr/share/git-core/contrib/completion/git-prompt.sh # Fedora ?? + /usr/share/git/git-prompt.sh # Arch, etc. (default?) + /usr/lib/git-core/git-sh-prompt # Debian, Ubuntu ... + /usr/share/git-core/contrib/completion/git-prompt.sh # Fedora ?? + # I have yet to find Alpine's git prompt location. ) for file in "${possible_git_prompt_locations[@]}"; do - if [[ -f "$file" ]]; then - source "$file" && - PS1+='\[\e[35m\]$(__git_ps1)' - break - fi + if [[ -f "$file" ]]; then + source "$file" && + PS1+='\[\e[35m\]$(__git_ps1)' + break + else + true + fi done # newline @@ -27,9 +30,9 @@ PS1+='\[\e[0m\]\n' # exit code (only if error) __prompt_exit_code() { - local ec=$? - (( $ec > 0 )) && - printf "$ec" + local ec=$? + (( $ec > 0 )) && + printf "$ec" } PS1+='\[\e[31m\]$(__prompt_exit_code)\[\e[0m\]' -- cgit 1.4.1-21-gabe81