Skip to content
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

Support changing the default shell without %ComSpec% #3317

Closed
EDToaster opened this issue Mar 21, 2023 · 4 comments
Closed

Support changing the default shell without %ComSpec% #3317

EDToaster opened this issue Mar 21, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@EDToaster
Copy link

Is your feature request related to a problem? Please describe.

This feature request is a workaround related to windows bug (unconfirmed?) when setting ComSpec to powershell

Steps to reproduce the issue (not related to WezTerm):

  1. Set ComSpec environment variable to powershell, like C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  2. Create a .bat file with contents pause
  3. Try to run the .bat file by double clicking on it, you'll see that roughly 10 powershell instances are spawned every second, causing the system to eventually run out of memory. Delete the bat file to kill all of the powershell instances before this happens

Not sure what causes this behaviour but it is untenable to change ComSpec at this time.

Describe the solution you'd like

Provide a way to specify the default shell without the use of ComSpec, maybe something like WEZTERM_DEFAULT_SHELL as an environment variable.

Everywhere online seems to suggest that you shouldn't alter the value of ComSpec since a lot of programs will assume it points to cmd.

Describe alternatives you've considered

A quick workaround is to call powershell in CMD every time i open wezterm, but that is annoying.

Additional context

This is the only other report related to the same issue I've found

sbt/sbt#6643

@EDToaster EDToaster added the enhancement New feature or request label Mar 21, 2023
@wez
Copy link
Owner

wez commented Mar 21, 2023

Please see: https://wezfurlong.org/wezterm/config/launch.html#changing-the-default-program

To change it just as a one-off, you can wezterm --config "default_prog='powershell.exe'" start

@wez wez closed this as completed Mar 21, 2023
@EDToaster
Copy link
Author

turns out i need to learn to read 👍 thanks!

@EDToaster
Copy link
Author

for anyone reading this in the future -- default_prog is a vec, so the correct syntax is

wezterm --config "default_prog={ 'program', 'args', 'args' }" start

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants