diff --git a/.profile b/.profile index cb546631..1430417a 100755 --- a/.profile +++ b/.profile @@ -25,6 +25,7 @@ # If it is not, open a bug report at gitlab.com/rehashedsalt/home and I'll take # care of it +# SHELLCHECK # Not finding these sources is none of my concern; they're out of scope # shellcheck disable=1091 # shellcheck disable=1090 @@ -180,7 +181,11 @@ _ps1() { ;; esac # Show the tilde instead of $HOME - cpwd="${PWD/#$HOME/\~}" + if [ "${PWD#$HOME}" != "$PWD" ]; then + cpwd="~${PWD#$HOME}" + else + cpwd="$PWD" + fi # Alert us if the last command failed fail="" if ! [ "$exitcode" = "0" ]; then