wt new-tab -d {path} does not work if path is the root directory of a drive in quotes #24020

Closed
opened 2026-01-31 08:59:12 +00:00 by claunia · 2 comments
Owner

Originally created by @driver1998 on GitHub (Jan 28, 2026).

Windows Terminal version

1.24.2682.0

Windows build number

10.0.26200.7623

Other Software

Custom Context Menu 5.7.0 (https://github.com/ikas-mc/ContextMenuForWindows11)

Steps to reproduce

This works: wt new-tab -d "C:\Program Files"

This also works: wt new-tab -d C:\

But this doesn't: wt new-tab -d "C:\"

This makes it a bit annoying in automation scenarios.

Like I would like to have a custom action in Explorer that opens up Terminal with a specific profile in the current directory, something like wt new-tab -d "{path}" won't work at the root directory, but will work in everywhere else.

Expected Behavior

wt new-tab -d "C:\" should work as well.

Actual Behavior

It errors with

[出现错误 2147942667 (0x8007010b) (启动“"C:\Program Files\PowerShell\7\pwsh.exe"”时)]
无法访问启动目录“C:\"”
Originally created by @driver1998 on GitHub (Jan 28, 2026). ### Windows Terminal version 1.24.2682.0 ### Windows build number 10.0.26200.7623 ### Other Software Custom Context Menu 5.7.0 (https://github.com/ikas-mc/ContextMenuForWindows11) ### Steps to reproduce This works: `wt new-tab -d "C:\Program Files"` This also works: `wt new-tab -d C:\` But this doesn't: `wt new-tab -d "C:\"` This makes it a bit annoying in automation scenarios. Like I would like to have a custom action in Explorer that opens up Terminal with a specific profile in the current directory, something like `wt new-tab -d "{path}"` won't work at the root directory, but will work in everywhere else. ### Expected Behavior `wt new-tab -d "C:\"` should work as well. ### Actual Behavior It errors with ``` [出现错误 2147942667 (0x8007010b) (启动“"C:\Program Files\PowerShell\7\pwsh.exe"”时)] 无法访问启动目录“C:\"” ```
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:59:12 +00:00
Author
Owner

@driver1998 commented on GitHub (Jan 28, 2026):

Current workaround: use wt new-tab -d . to let Terminal use the process CWD as starting directory.

@driver1998 commented on GitHub (Jan 28, 2026): Current workaround: use `wt new-tab -d .` to let Terminal use the process CWD as starting directory.
Author
Owner

@DHowett commented on GitHub (Jan 28, 2026):

Oh, sorry we missed this.

wt nt -d "C:\." works as well. Just do that!

If you have a shortcut that launches Terminal, you can specify %V\..

@DHowett commented on GitHub (Jan 28, 2026): Oh, sorry we missed this. `wt nt -d "C:\."` works as well. Just do that! If you have a shortcut that launches Terminal, you can specify `%V\.`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24020