From 14fc2fe82758ae458e4796dd734801a8fca85cd0 Mon Sep 17 00:00:00 2001 From: caem Date: Fri, 24 Jan 2025 12:49:08 +0100 Subject: [PATCH] dkjf --- modules/home/caem/core/zsh/conf.d/ps1.zsh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/home/caem/core/zsh/conf.d/ps1.zsh b/modules/home/caem/core/zsh/conf.d/ps1.zsh index 1b2c880..cbae3f3 100644 --- a/modules/home/caem/core/zsh/conf.d/ps1.zsh +++ b/modules/home/caem/core/zsh/conf.d/ps1.zsh @@ -1,21 +1,22 @@ #!/usr/bin/env zsh -# TODO: Add vcs and nix shell indicator +# TODO: Add vcs # stt colors -local c0=$'\e[0;0m' -local c31=$'\e[31;0m' -local c33=$'\e[33;0m' -local c34=$'\e[34;0m' -local c35=$'\e[35;0m' -local c38=$'\e[38;0m' +local c0='%{\e[0;0m%}' +local c31='%{\e[31;0m%}' +local c33='%{\e[33;0m%}' +local c34='%{\e[34;0m%}' +local c35='%{\e[35;0m%}' +local c38='%{\e[38;0m%}' # end colors -nix_shell_ps1_t=" $c34{$c33󱄅 shell$c34}$c0" +local nix_shell_ps1_t=" $c34{$c33󱄅 shell$c34}$c0" +local path_no_ghostty="$(echo "$PATH" | sed -e 's/:\/nix\/store\/.*-ghostty-.*\/bin://g')" if [ -n "$IN_NIX_SHELL" ]; then - nix_shell_ps1="$nix_shell_ps1_t" -elif [[ "$PATH" == *"/nix/store"* ]]; then + local nix_shell_ps1="$nix_shell_ps1_t" +elif [[ "$path_no_ghostty" == *"/nix/store"* ]]; then IN_NIX_SHELL=true - nix_shell_ps1="$nix_shell_ps1_t" + local nix_shell_ps1="$nix_shell_ps1_t" fi export PS1="${c35}[${c31}%3~${nix_shell_ps1}${c35}]${c0}# "