mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
Fix prompt_cwd on darwin systems when $PWD is "/private"
When $PWD is "/private", the prompt was printing "rivate". Skip the "/private" stripping if there's nothing after it. Prevent "/private" from being stripped anywhere but the beginning of the PWD. Fixes #173
This commit is contained in:
parent
4d1c0eaa52
commit
529d410bec
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,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||' -e "s|^$HOME|~|" -e 's-/\(\.\{0,1\}[^/]\)\([^/]*\)-/\1-g')
|
||||
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-'
|
||||
else
|
||||
echo '~'
|
||||
|
|
Loading…
Reference in a new issue