Skip to content

Open in Terminal does not open to correct directory if the name contains an opening square bracket #19839

@EncryptedCurse

Description

@EncryptedCurse

Windows Terminal version

1.23.20211.0

Windows build number

10.0.26200.0

Other Software

PowerShell 5.1.26100.7462

settings.json profile:

{
    "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoLogo",
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "hidden": false,
    "name": "PowerShell"
}

Steps to reproduce

  1. Set PowerShell as the default profile in Terminal.
  2. Create a directory with at least one opening square bracket, e.g. [ Example ] or [ Test.
  3. Click the Open in Terminal context menu item inside the aforementioned directory.

Expected Behavior

Terminal should open to the current File Explorer directory.

Actual Behavior

[ Example ]: Terminal opens in PowerShell's default directory, i.e. C:\Windows\System32\WindowsPowerShell\v1.0.

[ Test: Terminal opens to the root directory, i.e. C:\.

This issue does not occur with Command Prompt.

It also does not occur with curly brackets or if there is only a closing square bracket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions