Allow overriding the default shell on Windows
jaraco opened this issue · 4 comments
Is your feature request related to a problem? Please describe.
On Unix, I can chsh the default shell to my preferred shell and Hyper will honor that.
On Windows, there's no way to configure a default shell, as far as I can tell. I've tried overriding the COMSPEC variable, but that has no effect on Hyper.
I'd like not to have to configure the default shell in the configuration file as I'd like to re-use the same configuration file that I use on other platforms.
Describe the solution you'd like
Ideally, the user could configure something in the environment to change the default shell (e.g. DEFAULT_SHELL=%userprofile%/.local/bin/myshell.exe), and Hyper would honor that.
On further examination, I determined that the default-shell package as used by Hyper does honor COMSPEC. I must have done something wrong the first time I tried. I was able to configure COMSPEC in my environment and now Hyper loads that shell even when shell: '',.
On further consideration, while setting COMSPEC does in fact allow Hyper to launch a different shell, it also breaks other things that expect COMSPEC to refer to a cmd.exe-compatible shell, so setting it to my shell breaks those applications. It would be nice to be able to define an alternate default shell, maybe just for Hyper, but without affecting applications reliant on COMSPEC.
On 3.4.1 I can set my preferred shell to powershell by overriding shell in the config file. Is that what you're looking for?
The problem I have is that my config file is shared across different systems, so if I put "shell: C:\Users\jaraco.local\bin\xonsh.exe" there, the config file no longer works on my Mac or Linux machines. I really don't want to maintain per-platform config files that share 99% of their config (and then keep that 99% in sync manually).
On other machines, I'm able to use chsh to set a default shell and Hyper will use that with no shell set. On Windows, however, the default shell is always COMSPEC, which basically has to be cmd.exe for legacy reasons.
If there were a way on Windows to set a DEFAULT_SHELL or HYPER_DEFAULT_SHELL environment variable and Hyper could honor that, then the config would be 100% compatible across platforms and only the default shell would need to be managed in a platform-specific way.