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

Changing default WSL shell with chsh breaks wslgit #107

Closed
andy-5 opened this issue May 8, 2020 · 3 comments
Closed

Changing default WSL shell with chsh breaks wslgit #107

andy-5 opened this issue May 8, 2020 · 3 comments

Comments

@andy-5
Copy link
Owner

andy-5 commented May 8, 2020

It seems possible now to change the default shell in WSL using chsh, so the previous workarounds using .bashrc etc. are not required anymore. However, changing the default shell in that way currently breaks wslgit, as all commands seem to be sent through the default shell.

For example, after changing the default shell to fish

chsh -s $(which fish)

all commands use the default fish shell, even when bash is executed with wsl.exe. For example, the output of

wsl.exe bash -c "echo $SHELL"

after changing the default shell is something like

/usr/bin/fish

and thus the bash syntax used by wslgit for path translations does not work.

I've pushed a fix to the develop branch which uses the -e flag to wsl.exe. This prevents the use of the default shell. However, this changes the required escaping. I simplified the escaping so that all tests still pass, but I think this might need some more testing.
@carlolars, could you maybe test the latest changes if everything still works for your use cases?

@carlolars
Copy link
Contributor

Will do!
I see that you changed to 20.04, I'm still on 18.04 so had to modify tests. You could use wsl echo $WSL_DISTRO_NAME to get the distro name.

@carlolars
Copy link
Contributor

No problems to report. 👍

@andy-5
Copy link
Owner Author

andy-5 commented Jun 2, 2020

Great, thanks for testing.

@andy-5 andy-5 closed this as completed Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants