I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
Allows the length of each shortened path component to be customized by setting the `fish_prompt_pwd_dir_length` variable to the number of characters to include (plus a leading dot because that's special). Maintains the default behavior of shortening path components to just one character. You can also set `fish_prompt_pwd_dir_length` to an empty or invalid value or 0 to disable shortening completely.
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.
I break compatibility with Mac OS X again, that I don't have access
to. Result: Stuff break, and I have to fix it, so it will perhaps
work. At least, I hope it will work.
commit 5a577d970a293afe320b6c3280c10c2bd8a1ff50
Merge: 908b07596941b3
Author: ridiculousfish <corydoras@ridiculousfish.com>
Date: Sat Jun 1 22:59:16 2013 -0700
Merge branch 'dotdir-two-chars' of git://github.com/GlitchMr/fish-shell into GlitchMr-dotdir-two-chars
commit 96941b3a92
Author: Konrad Borowski <glitchmr@myopera.com>
Date: Sat May 25 09:55:43 2013 +0200
Support BSD sed
commit 60652c2bd2
Author: Konrad Borowski <glitchmr@myopera.com>
Date: Sun May 19 10:58:40 2013 +0200
Show first two characters for dotdirs. Fixes#754.
Remove the case statements, which were handled by the sed blocks anyway
Move around the '/' character in the regex, so only one regex is needed
Fix a bug where '/' is output as '//'
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 `//`.
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