-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mise does not operate well under Git Bash on Windows #4048
base: main
Are you sure you want to change the base?
Conversation
@@ -1,5 +1,5 @@ | |||
# shellcheck shell=bash | |||
export -a chpwd_functions | |||
declare -a chpwd_functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no -a
flag for export i assume this is supposed to be declare
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is necessary, I got it from here https://github.com/rvm/rvm/tree/master/scripts/extras/bash_zsh_support/chpwd
f90a9ea
to
2a08412
Compare
for what it's worth, I'm not sure git bash is a necessary use-case for us. There are many alternatives like shims, powershell, and wsl for windows users. |
I'm generally not a Windows user but I agree that shims and powershell seem to work well enough. Windows is a PITA anyways, in my last project Git Bash was my only option (was not allowed to use WSL or install anything else). While probably rare there might be some users restrained to such a setup. |
right but even then shims will work. What won't work is you won't see env vars unless you wrap things in tasks but as I'm sure you've heard me explain, that's kind of how I think projects should be setup anyways since it doesn't rely on shell extensions.
|
I noticed that when using shims in context of cygwin/mysys a |
isn't that already happening? |
What i mean is that i would expect for example that i can use |
is this something that can be configured with |
PATHEXT is a Windows environment variable and i am not aware of an equivalent in Git Bash/Cygwin. Emulating PATHEXT in Bash does also not seem to work. export PATHEXT=.com:.exe:.bat:.cmd
if declare -f command_not_found_handle >/dev/null; then
eval "original_command_not_found_handle() $(declare -f command_not_found_handle|tail -n +2)"
fi
command_not_found_handle(){
local PATHEXT_EXPANDED i
IFS=: read -a PATHEXT_EXPANDED<<<"$PATHEXT"
for i in "${PATHEXT_EXPANDED[@]}"; do
if type "$1$i" &>/dev/null; then
"$1$i" "${@:2}"
return $?
fi
done
if declare -f original_command_not_found_handle >/dev/null; then
original_command_not_found_handle "$@"
else
return 127
fi
} While this PR makes |
The following hook might be a workaround for the shims
|
Fixes #4011
Gave this a try but detection of
msys
orcygwin
does not work via$OSTYPE
as this is not available viaenv
soenv::var()
does not return anything. Not sure how reliable my approach viaMSYSTEM
andPWD
is though.Another unresolved issue seems to be related to line breaks on cygwin. The
.bashrc
file does not source successfully until its opened and saved (without changes). Probably would require ados2unix
on cygwin, not sure why that is not an issue on msys.