start wsl with command
Create a dedicated profile:
The commandline option also accepts arguments, which are directly passed to the shell on startup, allowing the direct usage of wsl.exe with an additional "startup command":
{
"guid": "{...}",
"hidden": false,
"name": "Ubuntu SSH",
"commandline": "wsl.exe ssh -L 3306:localhost:3306 -L 5900:localhost:5900 -L 8001:localhost:8001 [email protected]",
}
I can now start the shell via a batch file, which runs using the below; however, the downside is the new profile is shown in Windows Terminal's Profile Selection Menu:
wt -p "Ubuntu SSH"