microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.79k stars 6.53k forks source link

PowerToys Run Shell should support using wsl.exe as the default shell #30620

Open michaelmdresser opened 10 months ago

michaelmdresser commented 10 months ago

Description of the new feature / enhancement

The "Command execution" dropdown for the Shell plugin should support an option like "Run in WSL (wsl.exe) using Windows Terminal":

image

Scenario when this would be used?

I have scripts that run in WSL that I would like to be able to easily call via PowerToys Run's Shell plugin. Today, if I want to use PT Run for this, the key sequence is roughly:

  1. alt+space
  2. >wsl
  3. enter to open terminal
  4. script name
  5. enter to run script
  6. exit to leave wsl.exe
  7. enter (or exit if "Keep shell open") to close terminal

I would like for it to be like this:

  1. alt+space
  2. >script name
  3. enter to run script
  4. optional: enter/exit to close terminal if kept open

Supporting information

Related issues which I found:

htcfreek commented 10 months ago

@michaelmdresser Would #28889 or #29222 help here?

michaelmdresser commented 10 months ago

https://github.com/microsoft/PowerToys/issues/29222 would definitely help, I almost linked it but I decided that this issue is a sufficiently-different request to stay independent. #29222 is basically a workaround for this issue because the other terminal program I use supports launching WSL by default.

https://github.com/microsoft/PowerToys/issues/28889 might also help, but I'm unfamiliar with WT profiles -- my WT opens WSL by default but this doesn't seem to carry through when WT is opened by PowerToys Run Shell. That leads me to believe #28889 isn't what I'm looking for, but I could be wrong.

htcfreek commented 10 months ago

I will keep this here open. The implementation ofvthe other two I mentioned will need some time.