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.imgur.com/tIdRMvR.png
Running the bash.exe
or wsl.exe
commands just takes me to another bash shell from within that same bash shell.
https://i.imgur.com/OM1XTlG.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.
The only way you're going to launch a new window from WSL is if you use some sort of terminal emulator and launch it. There are a number of different options: wsltty, wsl-terminal, Conemu, and Cmder (which is based upon Conemu) all come to mind offhand.
Press alt + d and type get-bash and you are good to go.
To start using WSL, open up a PowerShell terminal and type wsl . If you've set up WSL correctly, you'll enter a bash terminal running on the WSL distro of choice. From here, you can run any Linux commands you wish.
To access the shell, simply type 'bash' in the Windows command prompt, and everything is good to go.
This works from a bash prompt in WSL.
cmd.exe /c start cmd.exe /c wsl.exe
(Solution found here)
There is no need to call cmd twice. I use this kind of thing:
cmd.exe /c start wsl.exe -d $WSL_DISTRO_NAME --user $LOGNAME -- ssh -p 23 -L 80:10.0.0.1:80 -L 443:10.0.0.1:443 username@remoteserver
this will open another wsl window for the same user and distribution of the caller window and start ssh session in it. The ssh session can be replaced with whatever you want to run in the new window ... if you want just the shell prompt omit everything after $LOGNAME
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With