"Open in Terminal" context menu item does not open terminal in that location #18407

Closed
opened 2026-01-31 06:13:01 +00:00 by claunia · 3 comments
Owner

Originally created by @eggbean on GitHub (Sep 9, 2022).

I have WSL2 (Pengwin) set as the default shell in Windows Terminal. The problem is that the "Open in Terminal" right-click context menu does not open WSL at that location. It always open at $HOME whatever the case.

Windows Terminal settings:

# Under Startup
Default profile: Pengwin
Default terminal application: Let Windows decide
When Terminal starts: Open a tab with the default profile
Launch mode: Default
New instance behaviour: Create a new window
# Under Pengwin
Command line: %ProgramFiles%\WindowsApps\WhitewaterFoundryLtd.Co.16571368D6CFF_22.3.2.0_x64__kd1vv0z0vy70w\DistroLauncher\pengwin.exe
Starting directory: blank
     Use parent process directory - ticked

I don't know what else could be relevant, but here is my entire settings.json.

Is it actually possible for WSL2 to open in file system locations using this context menu item or does it only work with cmd.exe?

At the moment I keep Alacritty installed just so that I can use its context menu item to open it at specific locations.

Originally created by @eggbean on GitHub (Sep 9, 2022). I have WSL2 (Pengwin) set as the default shell in Windows Terminal. The problem is that the "Open in Terminal" right-click context menu does not open WSL at that location. It always open at `$HOME` whatever the case. Windows Terminal settings: ``` # Under Startup Default profile: Pengwin Default terminal application: Let Windows decide When Terminal starts: Open a tab with the default profile Launch mode: Default New instance behaviour: Create a new window # Under Pengwin Command line: %ProgramFiles%\WindowsApps\WhitewaterFoundryLtd.Co.16571368D6CFF_22.3.2.0_x64__kd1vv0z0vy70w\DistroLauncher\pengwin.exe Starting directory: blank Use parent process directory - ticked ``` I don't know what else could be relevant, [but here is my entire settings.json](http://sprunge.us/NWknNo). Is it actually possible for WSL2 to open in file system locations using this context menu item or does it only work with cmd.exe? At the moment I keep Alacritty installed just so that I can use its context menu item to open it at specific locations.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 06:13:01 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 9, 2022):

Ah, this is the same root cause as the Ubuntu startingDirectory bug. Pengwin has included a JSON file that overrides the commandline to point to pengwin.exe, but pengwin.exe does not respect the starting directory. Any executable that ignores its working directory will exhibit this behavior.

The best option is to let them know; this will break starting directory inheritance for any invocation of pengwin inside or outside of Terminal[1].

The second best option is to set the commandline back to wsl -d Pengwin (or whatever it's actually called when you run wsl -l)

[1] you can see this if you run, from cmd, cd c:\users & pengwin.

@DHowett commented on GitHub (Sep 9, 2022): Ah, this is the same root cause as the Ubuntu `startingDirectory` bug. Pengwin has included a JSON file that overrides the commandline to point to `pengwin.exe`, but `pengwin.exe` _does not respect the starting directory._ Any executable that ignores its working directory will exhibit this behavior. The best option is to let them know; this will break starting directory inheritance for any invocation of `pengwin` inside or outside of Terminal[1]. The second best option is to set the commandline back to `wsl -d Pengwin` (or whatever it's actually called when you run `wsl -l`) [1] you can see this if you run, from cmd, `cd c:\users & pengwin`.
Author
Owner

@eggbean commented on GitHub (Sep 9, 2022):

In Windows Terminal settings I have changed Command line: to wsl -d WLinux (which is the original name for Pengwin) and I changed Starting directory: to ~ and it's doing exactly what. I'll mention it in their Issues. Thanks for your help.

@eggbean commented on GitHub (Sep 9, 2022): In Windows Terminal settings I have changed `Command line:` to `wsl -d WLinux` (which is the original name for Pengwin) and I changed `Starting directory:` to `~` and it's doing exactly what. I'll mention it in their Issues. Thanks for your help.
Author
Owner

@DHowett commented on GitHub (Sep 9, 2022):

Thanks for confirming! :)

@DHowett commented on GitHub (Sep 9, 2022): Thanks for confirming! :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18407