From 1bd0a90e9e45b51e3c0cdbdb4e68b2329838c478 Mon Sep 17 00:00:00 2001 From: Olivier Tilmans Date: Tue, 20 Sep 2016 10:35:09 +0200 Subject: [PATCH] agnoster: add guard to bzr prompt Depending on the exit code of 'bzr status' is not enough, as some command_not_found_handler could be used which would then override that code. Use the associative list of commands from zsh/param instead. Signed-off-by: Olivier Tilmans --- themes/agnoster.zsh-theme | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index e1a294ee8..06e7977ba 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -128,6 +128,7 @@ prompt_git() { } prompt_bzr() { + (( $+commands[bzr] )) || return if (bzr status >/dev/null 2>&1); then status_mod=`bzr status | head -n1 | grep "modified" | wc -m` status_all=`bzr status | head -n1 | wc -m`