aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-04-01 11:51:37 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-04-01 11:51:37 +0300
commit614a6ed1ca8bcad6a5960457c6cd3acd15bc0456 (patch)
tree566740457a718b4397cfa33e4c9660493b827975
parentcb9788b12a1fade6be631ad905928f9a5f7eb03f (diff)
display nix_shell if path contains /nix/store/* (#2246)
-rw-r--r--internal/p10k.zsh6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index a8662762..b0096548 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4963,11 +4963,13 @@ function prompt_nix_shell() {
}
_p9k_prompt_nix_shell_init() {
- typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${IN_NIX_SHELL:#0}'
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}'
}
function instant_prompt_nix_shell() {
- _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 '${IN_NIX_SHELL:#0}' '${(M)IN_NIX_SHELL:#(pure|impure)}'
+ _p9k_prompt_segment prompt_nix_shell 4 $_p9k_color1 NIX_SHELL_ICON 1 \
+ '${IN_NIX_SHELL:#0}${${path[(I)/nix/store/*]}:#0}' \
+ '${(M)IN_NIX_SHELL:#(pure|impure)}'
}
function prompt_terraform() {