How do I get WSL to start my login shell by default?

The "Bash on Ubuntu on Windows" application always starts, well, bash. I have used chsh to set another shell as my login shell. How do I get WSL to start that shell instead?

1 Answer

This is fixed in a currently Insider-only build, with the new wsl.exe command:

As of build 16188 when running bash.exe without arguments (or with the ~ argument) bash will be launched as a login shell. The same is true for the new wsl.exe binary (with the exception that wsl launches your user's default shell as a login shell).

Prior to this, you'd have to edit the shortcut to add command-line parameters (such as -c 'exec "$SHELL" -l'):

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like