The "big" change is adding string escape on the working directory (it's then passed through string unescape in fish_prompt).
While I was at it, I also made the style a bit more consistent and removed a little duplication.
This shoud fix #27 (ie. it does in my tests, but it's difficult to exclude there may be more strangeness).
There is still a potential issue if one is in a git directory and the path to the git "root" contains a colon (yes, quite the astral conjunciton :smile: ). This is because a colon as a magic value in string replace -- "/$toplevel/" /:/ to preserve the full unshortened (is it a word?) directory name of the git root... I guess it should be fixed by splitting the PWD in three portions (before the git root, git root segment, after the git root) and shortening parts 1 and 3 separately.
The "big" change is adding
string escape
on the working directory (it's then passed throughstring unescape
infish_prompt
).While I was at it, I also made the style a bit more consistent and removed a little duplication.
This shoud fix #27 (ie. it does in my tests, but it's difficult to exclude there may be more strangeness).
There is still a potential issue if one is in a git directory and the path to the git "root" contains a colon (yes, quite the astral conjunciton :smile: ). This is because a colon as a magic value in
string replace -- "/$toplevel/" /:/
to preserve the full unshortened (is it a word?) directory name of the git root... I guess it should be fixed by splitting thePWD
in three portions (before the git root, git root segment, after the git root) and shortening parts 1 and 3 separately.