From 614a6ed1ca8bcad6a5960457c6cd3acd15bc0456 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 1 Apr 2023 10:51:37 +0200 Subject: [PATCH] display nix_shell if path contains /nix/store/* (#2246) --- internal/p10k.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a866276..b009654 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() {