diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 54ceb84b..553cebda 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -249,13 +249,11 @@ maybe_create_home () # c:\msys\usr\bin\bash -c "cd '%curdir'; export # CHERE_INVOKING=1; exec /usr/bin/bash --login -i" # - # Make sure we start in home unless invoked by CHERE - if [ ! -z "${CHERE_INVOKING}" ]; then - unset CHERE_INVOKING - elif [ "${CD_HOME}" = "yes" ]; then - unset CD_HOME + # Make sure we start in home if invoked through msys2_shell.cmd without -here option + if [ -z "${CHERE_INVOKING}" -a "${CD_HOME}" = "yes" ]; then cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi + unset CHERE_INVOKING CD_HOME } maybe_create_home