diff options
author | 2015-10-05 19:20:09 +0200 | |
---|---|---|
committer | 2015-10-09 17:45:45 +0200 | |
commit | 86471ac21f09273403708aa60dccd79944b37a52 (patch) | |
tree | 7864e8d4082df785252e30b101307662623bd5d4 /share/functions | |
parent | 57e22e87c2f76583fde01c9e5a89ff84fcde2ad7 (diff) |
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.
Diffstat (limited to 'share/functions')
-rw-r--r-- | share/functions/prompt_pwd.fish | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 59b6da91..4c766599 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -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 |