Skip to content

The validation of shell paths does not work properly for empty strings #72601

@roottool

Description

@roottool

Environment

  • VSCode Version: 1.34.0
  • OS Version: Windows_NT x64 10.0.17763

Description

I found this issue when I was trying to fix #72425.
_validateShellPaths function in src\vs\workbench\contrib\terminal\common\terminalService.ts does not work properly when an array include an empty string at the beginning is sent to _validateShellPaths function.

Steps to Reproduce

  1. Add the below to expectedLocations in src\vs\workbench\contrib\terminal\electron-browser\terminalService.ts.
test: ['', `${system32Path}\\cmd.exe`],
  1. Run npm(or yarn) run watch
  2. Choose the Launch VS Code launch configuration from the launch dropdown in the Debug viewlet and press F5.
  3. Press Ctrl+Shift+P.
  4. Select Terminal: Select Default Shell.

Expect behavior

Choose ${system32Path}\\cmd.exe

Actual behavior

Choose an empty string

Screenshot

ValidationDoesNotWorkProperlyForEmptyStrings

Note

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggood first issueIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions