mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Bring prompt_pwd under Darwin to parity with non-Darwin
The echo command to print the last path segment got a couplel of fixes, but these fixes were only applied to the non-Darwin version. Copy these fixes over to the Darwin version. Notably, this makes `/` stop displaying as `//`.
This commit is contained in:
parent
529d410bec
commit
1a93cbba1e
1 changed files with 1 additions and 2 deletions
|
@ -3,7 +3,7 @@ if test (uname) = Darwin
|
|||
function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
|
||||
if test "$PWD" != "$HOME"
|
||||
printf "%s" (echo $PWD|sed -e 's|^/private\(/.\{1,\}\)|\1|' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g')
|
||||
echo $PWD|sed -e 's-.*/\.\{0,1\}[^/]\([^/]*$\)-\1-'
|
||||
echo $PWD|sed -n -e 's-.*/\.\{0,1\}.\([^/]*\)-\1-p'
|
||||
else
|
||||
echo '~'
|
||||
end
|
||||
|
@ -20,4 +20,3 @@ else
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue