Can't run PowerShell correctly from a path with square brackets #20840

Open
opened 2026-01-31 07:25:33 +00:00 by claunia · 0 comments
Owner

Originally created by @Fly252 on GitHub (Nov 17, 2023).

Windows Terminal version

1.18.2822.0

Windows build number

10.0.22631.0

Other Software

PSVersion: 5.1.22621.2506

Steps to reproduce

  1. Set Windows PowerShell as default profile of Windows Terminal
  2. Run following command in PowerShell
wt -d 'D:\TEMP\[test]'

OR

  1. Set Windows PowerShell as default profile
  2. Go to the folder "D:\TEMP\[test]" in Windows Explorer
  3. Right click in Windows Explorer, and click "Open in Windows Terminal"

Expected Behavior

Windows Terminal is launched and current working location is set to "D:\TEMP\[test]"

Actual Behavior

Current working location is set to "C:\WINDOWS\System32\WindowsPowerShell\v1.0"
屏幕截图 2023-11-17 155805

Originally created by @Fly252 on GitHub (Nov 17, 2023). ### Windows Terminal version 1.18.2822.0 ### Windows build number 10.0.22631.0 ### Other Software PSVersion: 5.1.22621.2506 ### Steps to reproduce 1. Set Windows PowerShell as default profile of Windows Terminal 2. Run following command in PowerShell ``` wt -d 'D:\TEMP\[test]' ``` OR 1. Set Windows PowerShell as default profile 2. Go to the folder "D:\TEMP\\[test]" in Windows Explorer 3. Right click in Windows Explorer, and click "Open in Windows Terminal" ### Expected Behavior Windows Terminal is launched and current working location is set to "D:\TEMP\\[test]" ### Actual Behavior Current working location is set to "C:\WINDOWS\System32\WindowsPowerShell\v1.0" ![屏幕截图 2023-11-17 155805](https://github.com/microsoft/terminal/assets/62587815/67a0078f-376b-4e2e-aa2d-e8b8f36b7e56)
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:25:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20840