With pure prompt, git status is not displayed if you use a different git dir path (and set $GIT_DIR
and $GIT_WORK_TREE
accordingly).
prompt_pure_system_report
):- Zsh: zsh 5.8 (x86_64-pc-linux-gnu) (/usr/bin/zsh)
- Operating system: Linux (#1 ZEN SMP PREEMPT Wed, 06 May 2020 17:32:39 +0000)
- Terminal program: Konsole 20.04.0 (but also occurs in latest iTerm2)
- Tmux: yes
- Git: git version 2.26.2
- Pure state:
- username: `''`
- prompt: `❯`
- version: `1.11.0`
- PROMPT: `typeset -g PROMPT=$'%F{${prompt_pure_colors[path]}}%~%f
%{
%}%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f '`
- Colors: `typeset -g -A prompt_pure_colors=( [execution_time]=yellow [git:action]=yellow [git:arrow]=cyan [git:branch]=magenta [git:branch:cached]=red [git:dirty]=218 [git:stash]=cyan [host]=yellow [path]=blue [prompt:continuation]=242 [prompt:error]=red [prompt:success]=green [user]=green [user:root]=default [virtualenv]=242 )`
- Virtualenv: `export VIRTUAL_ENV_DISABLE_PROMPT=1`
- Conda: `export CONDA_CHANGEPS1=no`
- Detected frameworks: None
$GIT_DIR
and $GIT_WORK_TREE
are not respected unless already set before prompt is loaded.
cd /tmp/puregit
export GIT_DIR=`pwd`/.notgit GIT_WORK_TREE=`pwd`
git init
./.notgit
dir:git status
zsh
(from this shell)zsh
.zshrc
:#!/usr/bin/env zsh
declare -A ZINIT
ZINIT[HOME_DIR]="$HOME/.zinit"
ZINIT[BIN_DIR]="${ZINIT[HOME_DIR]}/bin"
source "${ZINIT[BIN_DIR]}/zinit.zsh"
zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh'
zinit light "sindresorhus/pure"
I think this is related to the fact that the vcs_info stuff is done in an async subshell(?). When you export the git env vars, they aren't passed to the async processes, so they don't take them into account.
Is there any way to have the async process get these variables after it's initialized? It doesn't have to be immediate (since, you know, it's async), but the next vcs_info check should be passed these variables.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too