chore: make fish_cwd_prompt return ~/media instead of radio/media when cwd parent directory is $HOME

pull/1/head
anemofilia 2023-09-18 14:37:27 -03:00
parent 707705a92b
commit d534ce7ab0
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
1 changed files with 9 additions and 3 deletions

View File

@ -24,9 +24,15 @@ function fish_cwd_prompt
case "/"
printf "/"
case "*"
set -l parent_dir (basename (dirname $cwd))
test $parent_dir = "/" || printf "%s" $parent_dir
printf '/%s' (basename $cwd)
set -l parent_dir (dirname $cwd)
switch "$parent_dir"
case "$HOME"
printf "~/%s" (basename $cwd)
case "/"
printf "/%s" (basename $cwd)
case "*"
printf "%s/%s" (basename $parent_dir) (basename $cwd)
end
end
end