Windows Terminal folder on path, causes problems with wt.exe #17887

Closed
opened 2026-01-31 05:57:27 +00:00 by claunia · 6 comments
Owner

Originally created by @ashbob999 on GitHub (Jul 8, 2022).

Windows Terminal version

1.15.1862.0 (Preview from windows store)

Windows build number

10.0.19044.1806

Other Software

No response

Steps to reproduce

Open Windows Terminal to a Ubuntu (wsl) tab.
Then open a new Command Prompt tab.
Run wt.exe -h.

Expected Behavior

Running wt.exe in any windows terminal window should work as expected.

Actual Behavior

wt.exe does not work, it finds wt.exe but does not produce any output.
Running where wt.exe produces:

C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe\wt.exe
C:\Users\ashbo\AppData\Local\Microsoft\WindowsApps\wt.exe

I have tested that both of these work correctly when run from the regular command prompt.
Also it seems like it only affects windows terminal instances that were created with an Ubuntu (wsl) tab, because if i run where wt.exe in a second windows terminal instance it produces:

C:\Users\ashbo\AppData\Local\Microsoft\WindowsApps\wt.exe

From looking at the %Path% variable, it seems like it's a problem if
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe
is in the path.

If i temporarily remove it from the Path, using:
set PATH=%PATH:C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe;=%
then it sees to work correctly, but only on that specific tab (where the Path has been modified).

So it seems like whenever a new terminal window is created, with the start tab being Ubuntu (wsl). Then whenever a command prompt is created within that window, either by a new tab, or through cmd.exe in wsl. The Path is updated to include the windows terminal folder. Which then breaks the wt.exe command.

Originally created by @ashbob999 on GitHub (Jul 8, 2022). ### Windows Terminal version 1.15.1862.0 (Preview from windows store) ### Windows build number 10.0.19044.1806 ### Other Software _No response_ ### Steps to reproduce Open Windows Terminal to a Ubuntu (wsl) tab. Then open a new Command Prompt tab. Run `wt.exe -h`. ### Expected Behavior Running `wt.exe` in any windows terminal window should work as expected. ### Actual Behavior `wt.exe` does not work, it finds `wt.exe` but does not produce any output. Running `where wt.exe` produces: ``` C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe\wt.exe C:\Users\ashbo\AppData\Local\Microsoft\WindowsApps\wt.exe ``` I have tested that both of these work correctly when run from the regular command prompt. Also it seems like it only affects windows terminal instances that were created with an Ubuntu (wsl) tab, because if i run `where wt.exe` in a second windows terminal instance it produces: ``` C:\Users\ashbo\AppData\Local\Microsoft\WindowsApps\wt.exe ``` From looking at the %Path% variable, it seems like it's a problem if ```C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe``` is in the path. If i temporarily remove it from the Path, using: `set PATH=%PATH:C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.15.1862.0_x64__8wekyb3d8bbwe;=%` then it sees to work correctly, but only on that specific tab (where the Path has been modified). So it seems like whenever a new terminal window is created, with the start tab being Ubuntu (wsl). Then whenever a command prompt is created within that window, either by a new tab, or through `cmd.exe` in wsl. The Path is updated to include the windows terminal folder. Which then breaks the `wt.exe` command.
claunia added the Issue-BugResolution-DuplicateCulprit-Centennial labels 2026-01-31 05:57:27 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 28, 2022):

So yes - having C:\Program Files\WindowsApps\Microsoft.WindowsTerminal* on the path will definitely break things. The stuff in there is all ACL'd up so that only the OS can read/write it, by design.

What's highly unusual is having that path get added to the PATH. Is there something in your WSL config that's adding anything to the path/? Unfortunately, I'm not super familiar with how stuff like WSLENV works these days. Maybe @craigloewen-msft can help triage.

The goal here is to figure out whatever is inserting that WindowsApps path into the PATH, cause that just ain't right

@zadjii-msft commented on GitHub (Jul 28, 2022): So yes - having `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal*` on the path will definitely break things. The stuff in there is all ACL'd up so that only the OS can read/write it, by design. What's highly unusual is having that path get added to the PATH. Is there something in your WSL config that's adding anything to the path/? Unfortunately, I'm not super familiar with how stuff like WSLENV works these days. Maybe @craigloewen-msft can help triage. The goal here is to figure out whatever is inserting that `WindowsApps` path into the PATH, cause that just ain't right
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Jul 28, 2022):

I can reproduce this, but it is not specific to WSL.

  1. Pin Windows Terminal Preview 1.15.2002.0 to the task bar on Windows 10.0.19044.1826.
  2. Set Command Prompt as the default profile.
  3. Close Windows Terminal Preview.
  4. Start Windows Terminal Preview by left-clicking the task-bar button.
  5. Execute "PATH" in the Command Prompt session. The output does not include the Windows Terminal Preview installation directory. OK
  6. Open another tab by right-clicking the task-bar button and left-clicking the "Command Prompt" task.
  7. Execute "PATH" in the Command Prompt session in the second tab. The output does not include the Windows Terminal Preview installation directory. OK
  8. Close Windows Terminal Preview.
  9. Start Windows Terminal Preview by right-clicking the task-bar button and left-clicking the "Command Prompt" task.
  10. Execute "PATH" in the Command Prompt session. The output starts with Windows Terminal Preview installation directory. BAD
  11. Open another tab by right-clicking the task-bar button and left-clicking the "Command Prompt" task.
  12. Execute "PATH" in the Command Prompt session in the second tab. The output starts with Windows Terminal Preview installation directory. BAD

https://github.com/microsoft/terminal/issues/7204 was supposedly fixed for PATH inherited by the session, but it seems to have regressed.

@KalleOlaviNiemitalo commented on GitHub (Jul 28, 2022): I can reproduce this, but it is not specific to WSL. 1. Pin Windows Terminal Preview 1.15.2002.0 to the task bar on Windows 10.0.19044.1826. 2. Set Command Prompt as the default profile. 3. Close Windows Terminal Preview. 4. Start Windows Terminal Preview by left-clicking the task-bar button. 5. Execute "PATH" in the Command Prompt session. The output does not include the Windows Terminal Preview installation directory. **OK** 6. Open another tab by right-clicking the task-bar button and left-clicking the "Command Prompt" task. 7. Execute "PATH" in the Command Prompt session in the second tab. The output does not include the Windows Terminal Preview installation directory. **OK** 8. Close Windows Terminal Preview. 9. Start Windows Terminal Preview by right-clicking the task-bar button and left-clicking the "Command Prompt" task. 10. Execute "PATH" in the Command Prompt session. The output starts with Windows Terminal Preview installation directory. **BAD** 11. Open another tab by right-clicking the task-bar button and left-clicking the "Command Prompt" task. 12. Execute "PATH" in the Command Prompt session in the second tab. The output starts with Windows Terminal Preview installation directory. **BAD** <https://github.com/microsoft/terminal/issues/7204> was supposedly fixed for PATH inherited by the session, but it seems to have regressed.
Author
Owner

@zadjii-msft commented on GitHub (Jul 28, 2022):

oh ho ho, that's a great repro. Thanks for that. We can definitely forward that to the platform team.

This does look a lot like #7204 but I'm gonna keep this open for a sec so I'll remember to dedupe the others too.

@zadjii-msft commented on GitHub (Jul 28, 2022): oh ho ho, that's a great repro. Thanks for that. We can definitely forward that to the platform team. This does look a lot like #7204 but I'm gonna keep this open for a sec so I'll remember to dedupe the others too.
Author
Owner

@ashbob999 commented on GitHub (Jul 29, 2022):

I see there is a problem with the PATH being added to, which stops it working inside certain windows terminal instances.
But I think the main cause of the issue, it that the wt.exe in C:\Program Files\WindowsApps\Microsoft.WindowsTerminal* doesn't work.

So yes - having C:\Program Files\WindowsApps\Microsoft.WindowsTerminal* on the path will definitely break things. The stuff in there is all ACL'd up so that only the OS can read/write it, by design.

Maybe it's not meant to be run manually, but if I search for wt in the start menu, it shows the path as being C:\Program Files\WindowsApps\Microsoft.WindowsTerminal*\wt.exe. But also I cannot run wt or wt.exe from Win+R.

This is similar to #7188 but instead I get nothing happen (no error messages).
@KalleOlaviNiemitalo mentions about registry keys (#7188 comment).

When I install Windows Terminal Preview, AppXSvc creates the following Registry keys:

  • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe

Both of mine point to the same folder/wt.exe file as above.
If I rename both of these, then wt works from both start menu and Win+R. Although the wt shown in start menu loses it's icon.

@ashbob999 commented on GitHub (Jul 29, 2022): I see there is a problem with the PATH being added to, which stops it working inside certain windows terminal instances. But I think the main cause of the issue, it that the `wt.exe` in `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal*` doesn't work. > So yes - having `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal*` on the path will definitely break things. The stuff in there is all ACL'd up so that only the OS can read/write it, by design. Maybe it's not meant to be run manually, but if I search for `wt` in the start menu, it shows the path as being `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal*\wt.exe`. But also I cannot run `wt` or `wt.exe` from `Win+R`. This is similar to #7188 but instead I get nothing happen (no error messages). @KalleOlaviNiemitalo mentions about registry keys ([#7188 comment](https://github.com/microsoft/terminal/issues/7188#issuecomment-669046854)). > When I install Windows Terminal Preview, AppXSvc creates the following Registry keys: > - HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe > - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe Both of mine point to the same folder/`wt.exe` file as above. If I rename both of these, then `wt` works from both start menu and `Win+R`. Although the `wt` shown in start menu loses it's icon.
Author
Owner

@zadjii-msft commented on GitHub (Aug 25, 2022):

(never came back to dedupe)

/dup #7204

@zadjii-msft commented on GitHub (Aug 25, 2022): (never came back to dedupe) /dup #7204
Author
Owner

@ghost commented on GitHub (Aug 25, 2022):

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 (Aug 25, 2022): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17887