I am struggling to figure out how to launch a new "command prompt" window via a bash command in WSL. The goal is to launch a second prompt preferably already in bash.
I have already tried running cmd.exe
yet that just drops me to a standard windows command prompt cmd from with in the bash shell.
https://i.sstatic.net/f8leY.png
Running the bash.exe
or wsl.exe
commands just takes me to another bash shell from within that same bash shell.
https://i.sstatic.net/kA9Cw.png
I am using the Debian distribution for WSL though that should not matter.
I know you can make a new window from the standard command prompt by putting the start
command before the program. Yet I can not find the *nix equivalent or how to call a bash command from within WSL that does the same thing.
cmd.exe /c start bash
, but this question is off topic here. – Ethnostart
command, which defaults to calling WINAPICreateProcessW
with the flagCREATE_NEW_CONSOLE
. That sets the bash.exe console handle to a sentinel value that tells it to allocate a new console on startup instead of inheriting the parent's console. There's nothing inherent to this that requires using cmd.exe, or even a console application. For example, if Windows Python is installed, you could usepythonw.exe -c "import subprocess; subprocess.Popen('bash', creationflags=subprocess.CREATE_NEW_CONSOLE)"
. It's just a lot more verbose. – Ethno