The Terminal is unable to start PS in a directory having square brackets in its name #18565

Closed
opened 2026-01-31 06:17:48 +00:00 by claunia · 3 comments
Owner

Originally created by @UnknownLITE on GitHub (Sep 29, 2022).

Windows Terminal version

1.15.2712.0

Windows build number

10.0.19044 Build 19044

Other Software

Powershell - version 5.1.19041.1682

Steps to reproduce

Ensure Powershell is the default startup profile for Terminal

  1. Create a directory having square brackets in its name. Example- Example [Dir]
  2. Go into the created directory
  3. Use the context menu to open Terminal
    image
  4. Notice the location where it starts in

Expected Behavior

PS should open in the right directory, i.e. where the context menu is used

Actual Behavior

PS didn't open in the right directory, instead opens in C:\WINDOWS\System32\WindowsPowerShell\v1.0

Originally created by @UnknownLITE on GitHub (Sep 29, 2022). ### Windows Terminal version 1.15.2712.0 ### Windows build number 10.0.19044 Build 19044 ### Other Software Powershell - version `5.1.19041.1682` ### Steps to reproduce Ensure Powershell is the default startup profile for Terminal 1. Create a directory having square brackets in its name. **Example**- `Example [Dir]` 2. Go into the created directory 3. Use the context menu to open Terminal ![image](https://user-images.githubusercontent.com/91004913/193066480-ad980051-b204-4d47-a54f-fb2265153e7b.png) 4. Notice the location where it starts in ### Expected Behavior PS should open in the right directory, i.e. where the context menu is used ### Actual Behavior PS didn't open in the right directory, instead opens in `C:\WINDOWS\System32\WindowsPowerShell\v1.0`
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 06:17:48 +00:00
Author
Owner

@j4james commented on GitHub (Sep 29, 2022):

I believe this is a known bug in Windows PowerShell 5.1. See https://github.com/microsoft/terminal/issues/11149#issuecomment-914397136

@j4james commented on GitHub (Sep 29, 2022): I believe this is a known bug in Windows PowerShell 5.1. See https://github.com/microsoft/terminal/issues/11149#issuecomment-914397136
Author
Owner

@UnknownLITE commented on GitHub (Sep 30, 2022):

I just upgraded Powershell to LTS version 7.2.6, It fixed the issue 👍

@UnknownLITE commented on GitHub (Sep 30, 2022): I just upgraded Powershell to LTS version `7.2.6`, It fixed the issue 👍
Author
Owner

@UnknownLITE commented on GitHub (Sep 30, 2022):

Closing it as it is resolved at my side.

@UnknownLITE commented on GitHub (Sep 30, 2022): Closing it as it is resolved at my side.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18565