Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Fix on os x/zgen/zpresto, make blinking configureable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tritlo authored and ayyess committed May 17, 2016
1 parent 77005b9 commit 667c45b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,19 @@ build_right_prompt() {
fi

index=$((index + 1))
kill -s USR1 $$
if [[ "$POWERLEVEL9K_RPROMPT_RENDER_ASAP" == true ]]; then
kill -s USR1 $$
fi
done
if [[ "$POWERLEVEL9K_RPROMPT_RENDER_ASAP" != true ]]; then
kill -s USR1 $$
fi
}

if [[ "$POWERLEVEL9K_DISABLE_RPROMPT" != true ]]; then
POWERLEVEL9K_SOCKET=$(mktemp -q -t powerlevel_rprompt_$$_XXX )
powerlevel9k_async() {
: > $POWERLEVEL9K_SOCKET #reset file
: >! $POWERLEVEL9K_SOCKET #reset file
build_right_prompt
}
fi
Expand Down Expand Up @@ -1025,14 +1030,13 @@ $(print_icon 'MULTILINE_SECOND_PROMPT_PREFIX')"
}

powerlevel9k_tidy() {
rm $POWERLEVEL9K_SOCKET
POWERLEVEL9K_SOCKET=""
rm -f $POWERLEVEL9K_SOCKET
unset POWERLEVEL9K_SOCKET
if [ -n "$POWERLEVEL9K_ASYNC_PROC_PID" ]; then
kill -TERM $POWERLEVEL9K_ASYNC_PROC_PID >/dev/null 2>&1
fi
unset POWERLEVEL9K_SYNC_PROC_PID
unset POWERLEVEL9K_ASYNC_PROC_PID
}
trap powerlevel9k_tidy EXIT

TRAPUSR1() {
RPROMPT="$(cat $POWERLEVEL9K_SOCKET)"
Expand Down Expand Up @@ -1094,6 +1098,7 @@ powerlevel9k_init() {

# prepare prompts
add-zsh-hook precmd powerlevel9k_prepare_prompts
add-zsh-hook zshexit powerlevel9k_tidy

zle -N zle-line-init
zle -N zle-line-finish
Expand Down

0 comments on commit 667c45b

Please sign in to comment.