microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

satvikpendem opened this issue · comments

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)

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

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!

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.

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?

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?

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