hydro
hydro copied to clipboard
Home directory ~ substitution is not bound to beginning of path
If you have a home directory of e.g. /root and cd to /tmp/root, the path is shown as /tmp~.
The fix is to change
string replace --ignore-case -- ~ \~ $PWD
to something like:
string replace --ignore-case --regex -- (string join "" "^" ~) \~ $PWD
The string join seems to be needed to concatenate the ^ with the expanded ~.