Minor tweaks

- Proper conditional expression for printing XTerm titlebar stuff
- Local variables in precmd_flags_rprompt
This commit is contained in:
Eryn Wells 2012-10-10 13:56:46 -07:00
parent cbed169ca9
commit 738cadb50f

6
zshrc
View file

@ -33,7 +33,7 @@ prompt_newline()
precmd_xterm_title()
{
# Set xterm and screen titles
[ -n $DISPLAY ] && print -Pn "\e]2;%n@%m\a"
[[ -n "$DISPLAY" ]] && print -Pn "\e]2;%n@%m\a"
}
precmd_prompt()
@ -66,14 +66,14 @@ precmd_git_branch()
precmd_flags_rprompt()
{
local bgjob
local cmdstat
if (is-at-least '4.3.7'); then
bgjob="%(1j.[%B%F{magenta}%j%F{default}%b].)"
cmdstat="%(0?..[%B%F{red}%?%F{default}%b])"
isroot="%(!.%B%F{red}%#%F{default}%b.%#)"
else
bgjob="%(1j.[%{$fg_bold[magenta]%}%j%{$reset_color%}].)"
cmdstat="%(0?..[%{$fg_bold[red]%}%?%{$reset_color%}])"
isroot="%(!.%{$fg_bold[red]%}%#%{$reset_color%}.%#)"
fi
RPROMPT="$cmdstat$bgjob"