1
1
Fork 0

prompt_pwd.fish: Keep the initial / for dirs in /

This makes it behave like in zsh.
This commit is contained in:
Jonathan Schleifer 2020-02-12 21:54:30 +00:00
parent 9cbbdd4072
commit 3b305d4571

View file

@ -11,6 +11,10 @@ function prompt_pwd --description 'Print the current working directory'
# Replace $HOME with "~"
set realhome ~
set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD)
set tmp (basename $tmp)
basename $tmp
test $PWD = "/$tmp"
and set tmp $PWD
echo $tmp
end