diff options
-rw-r--r-- | bash/prompt.bash | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bash/prompt.bash b/bash/prompt.bash index df30c82..dfb84ca 100644 --- a/bash/prompt.bash +++ b/bash/prompt.bash | |||
@@ -4,22 +4,22 @@ PS1= | |||
4 | 4 | ||
5 | # user, host, and cwd | 5 | # user, host, and cwd |
6 | PROMPT_DIRTRIM=3 # how many dirs above current to print (rest are '...') | 6 | PROMPT_DIRTRIM=3 # how many dirs above current to print (rest are '...') |
7 | PS1+='\[\e[36m\]\u@\h \w' | 7 | PS1+='\[\e[0;46m\]\u@\h \w' |
8 | 8 | ||
9 | # git bit | 9 | # git bit |
10 | # see https://unix.stackexchange.com/questions/278206 | 10 | # see https://unix.stackexchange.com/questions/278206 |
11 | possible_git_prompt_locations=( | 11 | possible_git_prompt_locations=( |
12 | /usr/share/git/git-prompt.sh # Arch, etc. (default?) | 12 | /usr/share/git/git-prompt.sh # Arch, etc. (default?) |
13 | /usr/lib/git-core/git-sh-prompt # Debian, Ubuntu ... | 13 | /usr/lib/git-core/git-sh-prompt # Debian, Ubuntu ... |
14 | /usr/share/git-core/contrib/completion/git-prompt.sh # Fedora ?? | 14 | /usr/share/git-core/contrib/completion/git-prompt.sh # Fedora ?? |
15 | ) | 15 | ) |
16 | 16 | ||
17 | for file in "${possible_git_prompt_locations[@]}"; do | 17 | for file in "${possible_git_prompt_locations[@]}"; do |
18 | if [[ -f "$file" ]]; then | 18 | if [[ -f "$file" ]]; then |
19 | source "$file" && | 19 | source "$file" && |
20 | PS1+='\[\e[35m\]$(__git_ps1)' | 20 | PS1+='\[\e[35m\]$(__git_ps1)' |
21 | break | 21 | break |
22 | fi | 22 | fi |
23 | done | 23 | done |
24 | 24 | ||
25 | # newline | 25 | # newline |
@@ -27,9 +27,9 @@ PS1+='\[\e[0m\]\n' | |||
27 | 27 | ||
28 | # exit code (only if error) | 28 | # exit code (only if error) |
29 | __prompt_exit_code() { | 29 | __prompt_exit_code() { |
30 | local ec=$? | 30 | local ec=$? |
31 | (( $ec > 0 )) && | 31 | (( $ec > 0 )) && |
32 | printf "$ec" | 32 | printf "$ec" |
33 | } | 33 | } |
34 | PS1+='\[\e[31m\]$(__prompt_exit_code)\[\e[0m\]' | 34 | PS1+='\[\e[31m\]$(__prompt_exit_code)\[\e[0m\]' |
35 | 35 | ||