microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.07k stars 29.21k forks source link

Upon invocation, VS Code reports that it's unable to launch the shell, when `chsh -s` is `/snap/bin/powershell`. #219583

Open RokeJulianLockhart opened 4 months ago

RokeJulianLockhart commented 4 months ago
Does this issue occur when all extensions are disabled? Yes
VS Code Version code-insiders-1.91.0-1719555839.el8.rpm
OS Version cpe:/o:fedoraproject:fedora:40

I've not reported this at https://github.com/PowerShell/vscode-powershell/blob/1042d2f23535c518b32f37f6f44b62254a4116b4/.github/ISSUE_TEMPLATE/bug-report.yml because it occurs irrespective of whether https://github.com/PowerShell/vscode-powershell/releases/download/v2024.2.2/powershell-2024.2.2.vsix is enabled.

I have asked about something similar (caused by the same problem, but with Pylance) at r/VSCode and didn't receive any useful response.

Steps to Reproduce

When I launch code-insiders, the undermentioned error messages appear:

  1. Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 1, signal null)

  2. The terminal process "/snap/bin/powershell" failed to launch (exit code: 1).

  3. The terminal process "/snap/bin/pwsh '-NoProfile', '-EncodedCommand', 'SQBtAHAAbwByAHQALQBNAG8AZAB1AGwAZQAgACcALwBoAG8AbQBlAC8AUgBvAGsAZQBKAHUAbABpAGEAbgBMAG8AYwBrAGgAYQByAHQALwAuAHYAcwBjAG8AZABlAC0AaQBuAHMAaQBkAGUAcgBzAC8AZQB4AHQAZQBuAHMAaQBvAG4AcwAvAG0AcwAtAHYAcwBjAG8AZABlAC4AcABvAHcAZQByAHMAaABlAGwAbAAtADIAMAAyADQALgAzAC4AMgAvAG0AbwBkAHUAbABlAHMALwBQAG8AdwBlAHIAUwBoAGUAbABsAEUAZABpAHQAbwByAFMAZQByAHYAaQBjAGUAcwAvAFAAbwB3AGUAcgBTAGgAZQBsAGwARQBkAGkAdABvAHIAUwBlAHIAdgBpAGMAZQBzAC4AcABzAGQAMQAnADsAIABTAHQAYQByAHQALQBFAGQAaQB0AG8AcgBTAGUAcgB2AGkAYwBlAHMAIAAtAEgAbwBz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GUASgB1AGwAaQBhAG4ATABvAGMAawBoAGEAcgB0AC8ALgBjAG8AbgBmAGkAZwAvAEMAbwBkAGUAIAAtACAASQBuAHMAaQBkAGUAcgBzAC8AVQBzAGUAcgAvAGcAbABvAGIAYQBsAFMAdABvAHIAYQBnAGUALwBtAHMALQB2AHMAYwBvAGQAZQAuAHAAbwB3AGUAcgBzAGgAZQBsAGwALwBsAG8AZwBzAC8AMQA3ADEAOQA4ADUAOQA0ADAAMQAtADUAMgA4AGQANwAyADgAZgAtADMANAAzADkALQA0ADgAMAA2AC0AYgA2ADAAZAAtAGQANwA0ADEAZQAyADkAOQAwADUAMAAzADEANwAxADkAOAA1ADkAMwA5ADkAOAAxADYAJwAgAC0AUwBlAHMAcwBpAG8AbgBEAGUAdABhAGkAbABzAFAAYQB0AGgAIAAnAC8AaABvAG0AZQAvAFIAbwBrAGUASgB1AGwAaQBhAG4ATABvAGMAawBoAGEAcgB0AC8ALgBjAG8AbgBmAGkAZwAvAEMAbwBkAGUAIAAtACAASQBuAHMAaQBkAGUAcgBzAC8AVQBzAGUAcgAvAGcAbABvAGIAYQBsAFMAdABvAHIAYQBnAGUALwBtAHMALQB2AHMAYwBvAGQAZQAuAHAAbwB3AGUAcgBzAGgAZQBsAGwALwBzAGUAcwBzAGkAbwBuAHMALwBQAFMARQBTAC0AVgBTAEMAbwBkAGUALQA1ADAANwA4ADQANwAtADEANAAwADUANgA5AC4AagBzAG8AbgAnACAALQBGAGUAYQB0AHUAcgBlAEYAbABhAGcAcwAgAEAAKAApACAA'" failed to launch (exit code: 1).

  4. Screenshot_20240707_213002

...as the undermentioned demonstrates:

Screencast_20240707_212929.webm

They began after I chsh -s'd my $Env:SHELL to /snap/bin/powershell, as https://forum.snapcraft.io/t/revisionless-path-to-mounted-snap-package-resource/40565/21?u=beedellrokejulianloc recommends:

  1. getent passwd $(id -un) | awk -F : '{print $NF}' # [source](https://stackoverflow.com/revisions/16946720/3)
  2. /snap/bin/powershell

so it appears that VS Code doesn't support PowerShell as the login shell on Linux-based OSes, which is ironic.

RokeJulianLockhart commented 4 months ago

https://github.com/microsoft/vscode/issues/219583#issue-2384535717

These completely disappeared after:

chsh -s '/bin/bash' && Restart-Computer

...so the problem is indeed that it doesn't cope with the shell.