randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.38k stars 84 forks source link

pwsh.exe not found or not executable (when installed from MS Store) #286

Closed mastazi closed 3 years ago

mastazi commented 3 years ago

I have installed PowerShell from the Microsoft Store so I don't have to update it manually,

The following issue can only be reproduced when PowerShell is installed from the MS Store, there is no issue when I install it using the .msi installer. For the time being I reverted to using the installer, but I would appreciate if anyone had tips on how to get the Store version working.

--

When I try to open a PowerShell 7 tab, I get this error in the console:

FileNotFoundError: The command was not found or was not executable: pwsh.exe.

but, pwsh.exe is in my path:

which pwsh.exe
/c/Program Files/WindowsApps/Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe/pwsh.exe

I tried adding manually C:\Program Files\WindowsApps to the system environment variables but I got the same error.

my settings:

{
    "default_config": {
        "linux": null,    // login shell
        "osx": null,      // login shell
        "windows": "PowerShell Core"
    }
}
randy3k commented 3 years ago

Perhaps you need to specify the full path to the pwsh.exe in the settings.

mastazi commented 3 years ago

@randy3k thank you so much. Actually I had tried that but it was still giving me the FileNotFoundError, I think I must have mis-spelled the full path the first time around! After reading your comment I tried again, and it works now. For reference in case anyone gets here from a web search, I'm using:

        {
            "name": "PowerShell Core",
            "cmd": "C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.1.3.0_x64__8wekyb3d8bbwe\\pwsh.exe",
            "env": {},
            "enable": true,
            "platforms": ["windows"]
        },

closing the issue now.

brucmao commented 1 year ago

This is not good idea, I have to change the settings when powershell updated