hydro icon indicating copy to clipboard operation
hydro copied to clipboard

Home directory ~ substitution is not bound to beginning of path

Open pdc1 opened this issue 6 months ago • 0 comments

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 ~.

pdc1 avatar Jul 10 '25 18:07 pdc1