Search
 
SCRIPT & CODE EXAMPLE
 

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"
Comment

start wsl with command

Pass commandline to wt:
As shown in Option 1, the commandline option can include further parameters for the target shell, with the following working when called from a batch file:
wt wsl.exe ssh -L 3306:localhost:3306 -L 5900:localhost:5900 -L 8001:localhost:8001 user@target.com
I did not find any official online resources explaining why this works, adjusting the suggestions in this answer, so I'm not sure whether this is supposed to work this way or if it's a hidden/unintentional feature that could break in future versions.
Comment

wsl start windows program

To start any program is 
[program-name].exe

to open a file with its assigned program
explorer.exe myfile.bmp
Comment

PREVIOUS NEXT
Code Example
Shell :: get character frequency in linux 
Shell :: pull docker images for Mac M1 arm64 
Shell :: The main configuration file containing paths to utilities, services and packages used by Plesk 
Shell :: stop git advice on empty path spec 
Shell :: linux c programming for loop 
Shell :: sed beginning of file 
Shell :: how to change default directory in linux 
Shell :: Wallpaper kali 
Shell :: cdbangular install angular 
Shell :: awk column decimal to integer 
Shell :: post clone remove line in file 
Shell :: dächen auf linux in terminal 
Shell :: vscode is blacking out on wsl 
Shell :: nmap problem binding to interface 
Shell :: how to access external drives from linux chrome os 
Shell :: how to check the version of glibc in parrot os 
Shell :: haproxy user ulimit 
Shell :: linux mount lvm 
Shell :: increaments in shell 
Shell :: git find which files and folders are currently in the index 
Shell :: inquiring battery power level linux fedora 
Shell :: how to install deface makers for ubuntu 
Shell :: delete strings after match to eol using sed command 
Shell :: install bind9 ubuntu 16.04 
Shell :: set windows transaparancy linux 
Shell :: godot mask over mask 
Shell :: tcpdump localhost 
Shell :: head until last line 
Shell :: install godaddy ssl certificate on aws ec2 instance 
Shell :: E: Unable to locate package ros-noetic-depthimage-to-laserscan 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =