Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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 user@target.com",
}
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"
Source by superuser.com #
 
PREVIOUS NEXT
Tagged: #start #wsl #command
ADD COMMENT
Topic
Name
9+1 =