Open in Windows terminal does not work with Powershell and special characters #15890

Closed
opened 2026-01-31 04:51:27 +00:00 by claunia · 3 comments
Owner

Originally created by @codec-abc on GitHub (Nov 15, 2021).

Windows Terminal version (or Windows build number)

1.11.2921.0

Other Software

No response

Steps to reproduce

  1. Make Powershell as the default terminal
  2. Create a directory named [test]. Open it with Windows Explorer. Right click in the empty space and choose Open in Windows terminal .
  3. Powershell current directory should be in the directory. Instead it is in C:\Windows\System32\WindowsPowerShell\v1.0

if the [test] directory is renamed test it will work. So I guess the path given to the powershell prompt through the Windows Terminal are not escaped properly (or something similar).

Expected Behavior

The current directory of Powershell after using Open in Windows terminal should be the one from which the action was triggered in the explorer (at least for local path).

Actual Behavior

Powershell current directory reverted to C:\Windows\System32\WindowsPowerShell\v1.0

Originally created by @codec-abc on GitHub (Nov 15, 2021). ### Windows Terminal version (or Windows build number) 1.11.2921.0 ### Other Software _No response_ ### Steps to reproduce 1. Make Powershell as the default terminal 2. Create a directory named ``[test]``. Open it with Windows Explorer. Right click in the empty space and choose ``Open in Windows terminal ``. 3. Powershell current directory should be in the ``directory``. Instead it is in ``C:\Windows\System32\WindowsPowerShell\v1.0`` if the ``[test]`` directory is renamed ``test`` it will work. So I guess the path given to the powershell prompt through the Windows Terminal are not escaped properly (or something similar). ### Expected Behavior The current directory of Powershell after using ``Open in Windows terminal `` should be the one from which the action was triggered in the explorer (at least for local path). ### Actual Behavior Powershell current directory reverted to ``C:\Windows\System32\WindowsPowerShell\v1.0``
claunia added the Resolution-Duplicate label 2026-01-31 04:51:27 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 15, 2021):

Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #11652 for more discussion.

/dup #11652

Unfortunately, this is a PowerShell issue. The version of PowerShell that comes with Windows cannot handle being started in a folder that has [] in it. PowerShell 6+ does properly handle it, however.

@zadjii-msft commented on GitHub (Nov 15, 2021): Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #11652 for more discussion. /dup #11652 > Unfortunately, this is a PowerShell issue. The version of PowerShell that comes with Windows cannot handle being started in a folder that has `[]` in it. PowerShell 6+ _does_ properly handle it, however.
Author
Owner

@ghost commented on GitHub (Nov 15, 2021):

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!

@ghost commented on GitHub (Nov 15, 2021): 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!
Author
Owner

@codec-abc commented on GitHub (Nov 15, 2021):

Yes, sorry for not finding the duplicate :(

And yeah, installing Powershell 7 solves this. I guess Powershell 5 is a bit weird.

@codec-abc commented on GitHub (Nov 15, 2021): Yes, sorry for not finding the duplicate :( And yeah, installing Powershell 7 solves this. I guess Powershell 5 is a bit weird.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15890