|
|
@ -1,6 +1,8 @@ |
|
|
|
#!/bin/bash |
|
|
|
## (c) by wiebel (wiebel42@gmail.com) |
|
|
|
# Function to display the returncode of the previous command if not zero |
|
|
|
|
|
|
|
source /usr/share/git/git-prompt.sh |
|
|
|
ps1_return() { |
|
|
|
if [ "$1" != "0" ]; then |
|
|
|
echo -e "$1 " |
|
|
@ -190,7 +192,8 @@ else |
|
|
|
PS1P='\[$(ps1_write)\]\$ \[\033[0m\]' |
|
|
|
PS1ret='\[\033[01;31m\]$(ps1_return $?)' |
|
|
|
PS1dir='\[$(ps1_pre_color)\]$(ps1_pre)\[$(ps1_dir_color)\]$(ps1_dir $(ps1_pre))' |
|
|
|
export PS1="${PS1pre}${PS1U}${PS1H} ${PS1dir} ${PS1ret}${PS1P}" |
|
|
|
PS1git='$(__git_ps1 " (%s)")' |
|
|
|
export PS1="${PS1pre}${PS1U}${PS1H} ${PS1dir}${ON_COLOR}${PS1git} ${PS1ret}${PS1P}" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
@ -200,5 +203,5 @@ ROOT_SYM="\033[00;36m" |
|
|
|
HOME_SYM="\033[00;33m" |
|
|
|
|
|
|
|
SYM_COLOR="\033[00;36m" # cyan |
|
|
|
ON_COLOR="\033[01;37m" # white |
|
|
|
OFF_COLOR="\033[01;30m" # grey |
|
|
|
ON_COLOR="\033[01;97m" # white |
|
|
|
OFF_COLOR="\033[01;37m" # grey |
|
|
|