For various windows terminal profiles it seems to be possible to open up a new shell in the directory the shell has been opened with. (e.g. context menu option "Open in Terminal"), for WSL on the other hand it seems to be difficult to configure
You are able to set your wt start path by passing a "cd" arg to the wsl execution. I found that out here
I wasnt able to provide the cd arg with my current directory though. I tried to pass it the %cd% env var, the simple and classy dot, but without success.
"commandline": "wsl --cd %cd%",
"commandline": "wsl --cd .",
I also found this post that tells me that there is a built in tool that can convert paths to and from WSL. I thought this might be useful to convert the current path to a WSL one and provide in in the
"startingDirectory": "X",
property, as this one only accepts WSL paths as input.
I know that its possible to immediately go to the directory the shell has been opened with, because this functionality already exists when you do a Shift + open context menu (right mouse click) and select the option "Open Linux shell here". This only opens the shell in a seperate wsl window though, not in windows terminal.
wt wslfromcmd.exeopens terminal/bash in whatever directory I was in. Please describe in detail what you are trying to do. Yes, there are plenty of tricks to get a converted path.. I just don't understand where you are trying to use one. – Señor CMasMas Dec 15 '22 at 16:55