mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

PWSH explecit error

Open ynhhoJ opened this issue 2 years ago • 2 comments

I've searched open issues for similar requests

Yes

Is your feature request related to a problem? Please describe.

#706

Is it possible to add a hint during an error related to pwsh?

изображение

Windows 11 has powershell (legacy version) installed by default, but Mason requires a newer version of pwsh. I could not immediately understand where exactly the error was, and after installing the powershell 7.3 version, everything worked

Code: https://github.com/williamboman/mason.nvim/pull/706/files#diff-1243700016801fd3c68dbc2d65f32bd9e12ae30b09e45031248e6e49065cf168R224-R233

Describe the solution you'd like

  1. Write to the user that he needs a new version of powershell

Describe potential alternatives you've considered

  1. Or add legacy powershell support

Additional context

No response

ynhhoJ avatar Dec 15 '22 22:12 ynhhoJ

Faced same issue, why is that such a hard requirement for this specific package, can we not use the older version. I also faced the same issue on shellcheck and lemminx.

asmodeus812 avatar Dec 17 '22 07:12 asmodeus812

The same issue for me

emPeeGee avatar Dec 17 '22 11:12 emPeeGee

Facing the same issue here. Can't this just support the legacy version so us boomers don't have to install a brand new Powershell? It's an extra thing to keep in mind. This has to be documented either way, because as mentioned above, the default powershell version is still not pwsh for many systems.

adriancostin6 avatar Dec 19 '22 08:12 adriancostin6

Not only that, but this kind of completely borks support for win10 and even win11 by default which imo is bad idea. What was wrong with maybe checking which shell is available and use that instead, the more fallback options the better.

asmodeus812 avatar Dec 19 '22 08:12 asmodeus812

Hey! Ah that's interesting, I was under the impression that the old iteration of powershell had been phased out completely by now, seeing as the initial announcement was in 2017 IIRC. There's no particular reason to use pwsh, reverting back to powershell.exe should be perfectly fine

williamboman avatar Dec 19 '22 09:12 williamboman

I believe #769 fixes this by reverting the change. If it does not let's reopen.

williamboman avatar Dec 19 '22 10:12 williamboman

@williamboman , it is possible to do like this:

  1. If user doesn't have pwsh - use powershell
  2. If user have pwsh - use pwsh

ynhhoJ avatar Dec 19 '22 11:12 ynhhoJ

@williamboman , it is possible to do like this:

  1. If user doesn't have pwsh - use powershell
  2. If user have pwsh - use pwsh

I've wanted to avoid doing this, but it seems like it's the only option. I was hoping Windows environments would be more predictable haha. Mason doesn't really call into Powershell that much, and all cmdlet invocations should be fully cross-compatible between Powershell versions (for now..).

edit: Done in https://github.com/williamboman/mason.nvim/pull/782

williamboman avatar Dec 21 '22 08:12 williamboman

Just for documentation purposes: I created a script at ~/pwsh.sh with the following content as a workaround:

powershell "$@"

Wanted to create an issue for this, but found it was just fixed 😄 Thank you

Cluster7ck avatar Dec 22 '22 15:12 Cluster7ck