Unset $is_first_prompt instead setting it to 0 after its use
This commit is contained in:
parent
ab3f017c03
commit
be10e3bbc6
1 changed files with 5 additions and 5 deletions
8
zshrc
8
zshrc
|
@ -22,11 +22,10 @@ is_first_prompt=1
|
||||||
prompt_newline()
|
prompt_newline()
|
||||||
{
|
{
|
||||||
# Don't print newlines the first time the prompt is displayed.
|
# Don't print newlines the first time the prompt is displayed.
|
||||||
if [[ $is_first_prompt == 1 ]]; then
|
if [[ -n $is_first_prompt ]]; then
|
||||||
is_first_prompt=0
|
unset is_first_prompt
|
||||||
[[ -z $SSH_CONNECTION ]] && return
|
[[ -z $SSH_CONNECTION ]] && return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +68,8 @@ precmd_info()
|
||||||
|
|
||||||
precmd_git_branch()
|
precmd_git_branch()
|
||||||
{
|
{
|
||||||
local git_branch_output=`git branch 2>/dev/null`
|
local git_branch_output
|
||||||
|
git_branch_output=`git branch 2>/dev/null`
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
export gitbranch=`echo $git_branch_output | grep '^\*' | cut -d' ' -f2`
|
export gitbranch=`echo $git_branch_output | grep '^\*' | cut -d' ' -f2`
|
||||||
PROMPT_REPO="%B%F{cyan}$gitbranch%f%b"
|
PROMPT_REPO="%B%F{cyan}$gitbranch%f%b"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue