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

Closed
opened 2026-01-31 07:25:40 +00:00 by claunia · 2 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:40 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 17, 2023):

This is a known bug in Windows PowerShell 5.1. See https://github.com/microsoft/terminal/issues/11149#issuecomment-914397136. Sorry about that! I believe this is fixed in PowerShell 7+.

/dup #11149

@zadjii-msft commented on GitHub (Nov 17, 2023): This is a known bug in Windows PowerShell 5.1. See https://github.com/microsoft/terminal/issues/11149#issuecomment-914397136. Sorry about that! I believe this is fixed in PowerShell 7+. /dup #11149
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Nov 17, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Nov 17, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20844