fish-shell/fish-shell — pull request #208 by xymostech (2012-07-06 09:08:49+00:00)
Title: Make a more sensical prompt_pwd

In an attempt to make some sense of the prompt_pwd command, I believe I have come up with a more reasonable approach to the shortening of paths. In this new command, I:

- Removed the case statements, which were handled by the sed blocks anyway
- Moved around the '/' character in the regex, so only one regex is needed
- Fixed a bug where '/' is output as '//' because both lines output a '/' upon replacement

I've tested this on a Mac and on Arch Linux, so I'm fairly certain that it works, but more testing couldn't hurt. I hope this helps.