From 86091b74e9fb16008ac6469a161bf6a433db4732 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 11 Nov 2023 17:29:28 -0800 Subject: [PATCH] properly set CMDER_ROOT for windows terminal bash --- vendor/cmder.sh | 6 +++++- vendor/cmder_exinit | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index 8467593..dfbf91c 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -22,7 +22,11 @@ function runProfiled { } # We do this for bash as admin sessions since $CMDER_ROOT is not being set -if [ "$CMDER_ROOT" == "" ] ; then +if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then + export CMDER_ROOT=$(cygpath -u $cmder_root) +fi + +if [ -z "$CMDER_ROOT" ] ; then case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac else case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac diff --git a/vendor/cmder_exinit b/vendor/cmder_exinit index 4ec3351..8e1b604 100644 --- a/vendor/cmder_exinit +++ b/vendor/cmder_exinit @@ -44,6 +44,10 @@ function runProfiled { # Check that we haven't already been sourced. [[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return +if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then + export CMDER_ROOT=$(cygpath -u $cmder_root) +fi + # We do this for bash as admin sessions since $CMDER_ROOT is not being set if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then if [ -d "${ConEmuDir}../../vendor" ] ; then