Only replace $HOME with ~ if at beginning (fixes #250)

This commit is contained in:
Ilan Cosman 2022-01-19 07:13:20 -08:00
parent 3e0dc2c3dc
commit 9ca7a9c507

View File

@ -7,7 +7,7 @@ set -l home_icon $tide_pwd_icon_home'\ '
set -l pwd_icon $tide_pwd_icon'\ '
eval "function _tide_pwd
set -l split_pwd (string replace -- $HOME '~' \$PWD | string split /)
set -l split_pwd (string replace -r -- ^$HOME '~' \$PWD | string split /)
if not test -w \$PWD
set -f icon $unwritable_icon