From 428eb034ad6a29fe0a458cabc903a998c21b2410 Mon Sep 17 00:00:00 2001 From: arkbriar Date: Tue, 7 May 2024 15:47:48 +0800 Subject: [PATCH] Fix fish_prompt for special working directories Signed-off-by: arkbriar --- functions/fish_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 57b7ed1..3cd1250 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -6,9 +6,9 @@ function fish_prompt set -l pwd (prompt_pwd) set -l base (basename "$pwd") - set -l expr "s|~|"(__batman_color_fst)"^^"(__batman_color_off)"|g; \ + set -l expr "s|^~|"(__batman_color_fst)"^^"(__batman_color_off)"|g; \ s|/|"(__batman_color_snd)"/"(__batman_color_off)"|g; \ - s|"$base"|"(__batman_color_fst)$base(__batman_color_off)" |g" + s|"$base\$"|"(__batman_color_fst)$base(__batman_color_off)" |g" echo -n (echo "$pwd" | sed -e $expr)(__batman_color_off)