1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-25 16:31:57 +00:00

display nix_shell if path contains /nix/store/* (#2246)

This commit is contained in:
Roman Perepelitsa 2023-04-01 10:51:37 +02:00
parent cb9788b12a
commit 614a6ed1ca

View file

@ -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() {