"Open in Terminal" menu option should open in PowerShell or Ubuntu depending on folder location #19278

Open
opened 2026-01-31 06:38:54 +00:00 by claunia · 7 comments
Owner

Originally created by @satvikpendem on GitHub (Jan 28, 2023).

Description of the new feature/enhancement

Not sure if this is an enhancement versus an actual bug, but if have my default WSL distro be Ubuntu, and I click "Open in Terminal" in a Windows folder, I expect it to open up the PowerShell terminal, not the Ubuntu one. Vice versa if I have the default terminal as PowerShell and I click "Open in Terminal" in an Ubuntu folder, like in the below folders.

In other words, Terminal should know the context in which I'd want each terminal to open up.

image

Proposed technical implementation details (optional)

Originally created by @satvikpendem on GitHub (Jan 28, 2023). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Not sure if this is an enhancement versus an actual bug, but if have my default WSL distro be Ubuntu, and I click "Open in Terminal" in a Windows folder, I expect it to open up the *PowerShell* terminal, not the Ubuntu one. Vice versa if I have the default terminal as PowerShell and I click "Open in Terminal" in an Ubuntu folder, like in the below folders. In other words, Terminal should know the context in which I'd want each terminal to open up. ![image](https://user-images.githubusercontent.com/42670561/215248711-7115c3e4-071a-432c-aa64-f942e98fdc10.png) <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureHelp WantedProduct-TerminalArea-ShellExtension labels 2026-01-31 06:38:54 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 29, 2023):

This is a neat idea! However, I think we'd probably end up getting stuck trying to pick the "right" profile for each scenarios. E.g. what about someone with both Windows PowerShell and PowerShell 7? Or multiple WSL distros?

I think it'll be easier for us to just let folks pick the profile they want to open instead, That's tracked in /dup #6111

@zadjii-msft commented on GitHub (Jan 29, 2023): This is a neat idea! However, I think we'd probably end up getting stuck trying to pick the "right" profile for each scenarios. E.g. what about someone with both Windows PowerShell and PowerShell 7? Or multiple WSL distros? I think it'll be easier for us to just let folks pick the profile they want to open instead, That's tracked in /dup #6111
Author
Owner

@ghost commented on GitHub (Jan 29, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jan 29, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@DHowett commented on GitHub (Jan 30, 2023):

I actually think this is really clever and worth discussing more 😄

If the user has our stock profiles or any of the autodetected ones, we can absolutely know which distribution should be used to launch in which WSL directory.

@DHowett commented on GitHub (Jan 30, 2023): I actually think this is really clever and worth discussing more :smile: If the user has our stock profiles or any of the autodetected ones, we can absolutely know which distribution should be used to launch in which WSL directory.
Author
Owner

@zadjii-msft commented on GitHub (Jan 31, 2023):

I'm confident that us guessing means we'll guess wrong.

  • what about folks with the Canonical WSL profiles?
  • What about little old me with my Command Prompt default profile?
  • What about me with my non-built-in default profile?
  • What if I have a WSL set as the default, and I do want to open WSL navigated to %USERPROFILE%, so I can do sane bash scripting on my Windows files?
@zadjii-msft commented on GitHub (Jan 31, 2023): I'm confident that us guessing means we'll guess wrong. * what about folks with the Canonical WSL profiles? * What about little old me with my Command Prompt default profile? * What about me with my non-built-in default profile? * What if I have a WSL set as the default, and I _do_ want to open WSL navigated to %USERPROFILE%, so I can do ~sane~ bash scripting on my Windows files?
Author
Owner

@DHowett commented on GitHub (Jan 31, 2023):

Bullet point 4 is a bit beside the point - the shell extension changes the startingDirectory somewhat by design. 😄

For the rest: guessing wrong is low cost and I would posit rare. I guess the question is...

Is it more delightful for us to launch \\wsl\Debian\ paths into Debian under WSL automatically (before we have profile selection!) than it is annoying for us to not launch your default profile?

@DHowett commented on GitHub (Jan 31, 2023): Bullet point 4 is a bit beside the point - the shell extension changes the `startingDirectory` somewhat _by design._ :smile: For the rest: guessing wrong is low cost and I would posit rare. I guess the question is... Is it more delightful for us to launch `\\wsl\Debian\` paths into Debian under WSL automatically (before we have profile selection!) than it is annoying for us to not launch your default profile?
Author
Owner

@satvikpendem commented on GitHub (Feb 1, 2023):

I also suspect most users have the default PowerShell 7 and one WSL profile, so guessing correctly for most users would probably be accurate.

@satvikpendem commented on GitHub (Feb 1, 2023): I also suspect most users have the default PowerShell 7 and one WSL profile, so guessing correctly for most users would probably be accurate.
Author
Owner

@OldStarchy commented on GitHub (May 2, 2024):

Even if the guess is the wrong version of powershell (assuming you have more than one version installed) it would still at least give you a terminal in the correct directory. Currently the "Open in Terminal" option is 100% useless to me because it opens in WSL so I still have to go through roughly the same steps to open another terminal with powershell and navigate to the correct directory.

Opening the wrong powershell can more easily fixed by just manually running the correct pwsh command.

@OldStarchy commented on GitHub (May 2, 2024): Even if the guess is the wrong version of powershell (assuming you have more than one version installed) it would still at least give you a terminal in the correct directory. Currently the "Open in Terminal" option is 100% useless to me because it opens in WSL so I still have to go through roughly the same steps to open another terminal with powershell and navigate to the correct directory. Opening the wrong powershell can more easily fixed by just manually running the correct pwsh command.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19278