mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Remove OSX/Cygwin special cases from prompt_pwd
For cygwin, you can't `cd C:`, so a prompt of "C:/Something" is misleading. For OSX, we dereference symlinks elsewhere This also simplifies prompt_pwd quite a bit.
This commit is contained in:
parent
57e22e87c2
commit
86471ac21f
1 changed files with 2 additions and 13 deletions
|
@ -1,15 +1,4 @@
|
|||
set -l s1
|
||||
set -l r1
|
||||
switch (uname)
|
||||
case Darwin
|
||||
set s1 '^/private/'
|
||||
set r1 /
|
||||
case 'CYGWIN_*'
|
||||
set s1 '^/cygdrive/(.)'
|
||||
set r1 '$1:'
|
||||
end
|
||||
|
||||
function prompt_pwd -V s1 -V r1 --description "Print the current working directory, shortened to fit the prompt"
|
||||
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
|
||||
set realhome ~
|
||||
string replace -r '^'"$realhome"'($|/)' '~$1' $PWD | string replace -r "$s1" "$r1" | string replace -ar '([^/.])[^/]*/' '$1/'
|
||||
string replace -r '^'"$realhome"'($|/)' '~$1' $PWD | string replace -ar '([^/.])[^/]*/' '$1/'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue