-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Rewrite most of the shell detection stuff (do not merge) #2161
Conversation
Manually tested on cmd.exe, Powershell (pwsh.exe, but powershell.exe should work), and Bash in WSL. This needs more testers. |
Some explaination. I did some process-digging and it turns out there is not a trace of There are quite a few variants of subshell-spawning, each requiring a different call:
The logic gets complicated pretty quickly, so I decided to refactor them into five classes (plus an intermediate for the Cmder cases). |
shell_cmd += ['/k', cmderrc_path] | ||
if cwd: | ||
os.environ['CMDER_START'] = cwd | ||
fork_shell(env, shell_cmd, cwd) | ||
|
||
def _detect_shell(): |
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.
The decision tree in this function is kinda messy, wonder if we can clean this up any
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.
Rewrote this a bit. Not sure if this makes more sense.
Overall these changes make sense. I think we are maintaining 2 lists of windows compatible shells, we should consolidate those. Otherwise I think we can schedule this for 11.11 |
TODO:
|
Improving compatibility for bash in Windows
The goal is to fix #915 (comment)