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 committed May 16, 2016
1 parent 10b9b75 commit 7b0fc51
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions powerlevel9k.zsh-theme
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)
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 7b0fc51

Please sign in to comment.