Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,22 @@ prompt_pure_async_init() {
prompt_pure_async_tasks() {
setopt localoptions noshwordsplit

# Check if git integration is enabled (default: yes).
if ! zstyle -T ":prompt:pure:git" show; then
# Flush any in-flight async git jobs.
if (( ${prompt_pure_async_inited:-0} )); then
async_flush_jobs "prompt_pure"
fi

# Clear git state to handle runtime disabling.
unset prompt_pure_git_dirty prompt_pure_git_last_dirty_check_timestamp prompt_pure_git_arrows prompt_pure_git_stash prompt_pure_git_fetch_pattern
prompt_pure_vcs_info[branch]=
prompt_pure_vcs_info[top]=
prompt_pure_vcs_info[action]=
prompt_pure_vcs_info[pwd]=
return
fi

# Initialize the async worker.
prompt_pure_async_init

Expand All @@ -410,11 +426,7 @@ prompt_pure_async_tasks() {
async_flush_jobs "prompt_pure"

# Reset Git preprompt variables, switching working tree.
unset prompt_pure_git_dirty
unset prompt_pure_git_last_dirty_check_timestamp
unset prompt_pure_git_arrows
unset prompt_pure_git_stash
unset prompt_pure_git_fetch_pattern
unset prompt_pure_git_dirty prompt_pure_git_last_dirty_check_timestamp prompt_pure_git_arrows prompt_pure_git_stash prompt_pure_git_fetch_pattern
prompt_pure_vcs_info[branch]=
prompt_pure_vcs_info[top]=
fi
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ You can set Pure to only `git fetch` the upstream branch of the current local br

`zstyle :prompt:pure:environment:nix-shell show no`

Git integration is enabled by default, you can disable it with:

`zstyle :prompt:pure:git show no`

## Colors

As explained in ZSH's [manual](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting), color values can be:
Expand Down