Support PowerShell as the default shell on Unix-like platforms #60971
Labels
debug
Debug viewlet, configurations, breakpoints, adapter issues
feature-request
Request for new features or functionality
help wanted
Issues identified as good community contribution opportunities
Milestone
Migrated and generalized from dotnet/vscode-csharp#2605
It would be great if Visual Studio Code also supported a Unix configuration where PowerShell (Core) is configured as the user's default shell.
Below is an example of where that currently fails: when using an external terminal (as controlled by setting
console": "externalTerminal
) for debugging, the debugger-invocation command line assumes a POSIX-like shell on Unix, and submits a command using the latter's syntax, which breaks in PowerShell.There may be other, related cases.
In the debugger-invocation case, only a trivial tweak is required to support PowerShell too (see below).
Steps to reproduce
On a Unix-like platform with PowerShell Core installed, make the latter your default shell as follows:
chsh -s /usr/local/bin/pwsh
(macOS) orchsh -s /usr/bin/pwsh
(Linux).On Linux, reboot to make the new default shell take effect (not necessary on macOS).
Open any C# project in VS Code and debug with a
".NET Core Launch (console)"
configuration with setting"console": "externalTerminal"
Desired behavior
Debugger invocation should succeed.
Current behavior
Debugger invocation fails, because the command line sent to the terminal assumes POSIX-like-shell syntax (e.g.,
bash
), which PowerShell doesn't support.Sample symptom:
With a quoted path to
vsdbg
, the call would have to be prefixed with&
to make PowerShell happy.A pragmatic workaround would be not to quote the
vsdbg
path, which would make the call succeed in PowerShell too, without special-casing.This should be safe as long as the user's
$HOME
path has no embedded spaces - something I've never seen in the Unix world.The text was updated successfully, but these errors were encountered: