Skip to content

Commit 50def32

Browse files
committed
themes/bash: Added debian_chroot support
1 parent 40a783f commit 50def32

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

themes/bash.zsh-theme

+6-1
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,10 @@ function git_time_since_commit()
132132

133133
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
134134

135-
PROMPT='%{$reset_color%}%{$fg_bold[$NCOLOR]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}%{$fg_bold[gray]%}$(prompt_char) %{$reset_color%}'
135+
# set variable identifying the chroot you work in (used in the prompt below)
136+
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
137+
debian_chroot=$(cat /etc/debian_chroot)
138+
fi
139+
140+
PROMPT='%{$reset_color%}${debian_chroot:+($debian_chroot)}%{$fg_bold[$NCOLOR]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}%{$fg_bold[gray]%}$(prompt_char) %{$reset_color%}'
136141
RPROMPT='${return_status}$(scm_base_info)$(git_time_since_commit)$(git_prompt_status) %{$reset_color%}$(git_prompt_short_sha)$(git_prompt_info)'

0 commit comments

Comments
 (0)