prompt_pwd.fish: Keep the initial / for dirs in /
This makes it behave like in zsh.
This commit is contained in:
parent
9cbbdd4072
commit
3b305d4571
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue