From 28dcf5b0c9ef3d3c8032fcbd46d3c567a4499b2a Mon Sep 17 00:00:00 2001 From: Daniel YC Lin Date: Thu, 8 Aug 2013 08:44:58 +0000 Subject: [PATCH] dlintw theme support /etc/debian_chroot settings --- themes/dlintw.zsh-theme | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/themes/dlintw.zsh-theme b/themes/dlintw.zsh-theme index 94b6d7870..873a9dddc 100644 --- a/themes/dlintw.zsh-theme +++ b/themes/dlintw.zsh-theme @@ -2,10 +2,17 @@ # @author Daniel YC Lin # Shows the exit status of the last command if non-zero # Uses "#" instead of "$" when running as root + +# set variable debian_chroot if running in a chroot with /etc/debian_chroot +if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +p_chroot="${debian_chroot:+[$debian_chroot]}" p_time="%K{black}%B%F{yellow}%D{%H:%M:%S}%k" p_ret="%(0?.. %F{red}%? )" p_ps="%B%F{blue}%(#.#.$)%b " -PROMPT="$p_time$ret$p_ps%{$reset_color%}" +PROMPT="$p_chroot$p_time$ret$p_ps%{$reset_color%}" autoload -Uz vcs_info precmd () { vcs_info }