From be10e3bbc699f1544511fb8a5ab3f216980b2d0e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 10 Oct 2012 14:08:56 -0700 Subject: [PATCH] Unset $is_first_prompt instead setting it to 0 after its use --- zshrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zshrc b/zshrc index d82f5f2..aa0abcd 100644 --- a/zshrc +++ b/zshrc @@ -22,11 +22,10 @@ is_first_prompt=1 prompt_newline() { # Don't print newlines the first time the prompt is displayed. - if [[ $is_first_prompt == 1 ]]; then - is_first_prompt=0 + if [[ -n $is_first_prompt ]]; then + unset is_first_prompt [[ -z $SSH_CONNECTION ]] && return fi - echo } @@ -69,8 +68,9 @@ precmd_info() precmd_git_branch() { - local git_branch_output=`git branch 2>/dev/null` - if [[ $? -eq 0 ]]; then + local git_branch_output + git_branch_output=`git branch 2>/dev/null` + if [[ $? -eq 0 ]]; then export gitbranch=`echo $git_branch_output | grep '^\*' | cut -d' ' -f2` PROMPT_REPO="%B%F{cyan}$gitbranch%f%b" else