zsh: only print nix shell paths once
This commit is contained in:
parent
b67ad29800
commit
5397db3d0e
1 changed files with 7 additions and 7 deletions
|
@ -19,13 +19,11 @@ delta_prompt_symbol() {
|
|||
|
||||
delta_prompt_nix_shell() {
|
||||
if [[ -n "$IN_NIX3_SHELL" || -n "$IN_NIX_SHELL" ]]; then
|
||||
print -n " %F{cyan}>%F{blue}>%F{8}"
|
||||
print -Pn " %F{cyan}>%F{blue}>%F{8}"
|
||||
tr : '\n' <<<$PATH | grep '^/nix/store' | while read storepath; do
|
||||
print -n " ${${storepath#*-}%/*}"
|
||||
done
|
||||
print -n '%f\n '
|
||||
else
|
||||
print -n ' '
|
||||
print -P '%f'
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -50,11 +48,10 @@ delta_prompt_init() {
|
|||
fi
|
||||
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
PROMPT="$(delta_prompt_nix_shell)\$(delta_prompt_symbol \$? $symbol_color)Δ%f %F{8}$hostnamevar %c >%f "
|
||||
PROMPT=" \$(delta_prompt_symbol \$? $symbol_color)Δ%f %F{8}$hostnamevar %c >%f "
|
||||
else
|
||||
PROMPT="$(delta_prompt_nix_shell)\$(delta_prompt_symbol \$? $symbol_color)Δ%f %F{8}%c >%f "
|
||||
PROMPT=" \$(delta_prompt_symbol \$? $symbol_color)Δ%f %F{8}%c >%f "
|
||||
fi
|
||||
unfunction delta_prompt_nix_shell
|
||||
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:*' use-simple true
|
||||
|
@ -62,6 +59,9 @@ delta_prompt_init() {
|
|||
zstyle ':vcs_info:git*' actionformats '%b|%a'
|
||||
|
||||
zstyle ':vcs_info:*' max-exports 2
|
||||
|
||||
delta_prompt_nix_shell
|
||||
unfunction delta_prompt_nix_shell
|
||||
}
|
||||
|
||||
delta_prompt_git_status() {
|
||||
|
|
Loading…
Reference in a new issue