Win+R: wt launches a Windows Terminal that doesn't work for some apps. #10383

Closed
opened 2026-01-31 02:20:05 +00:00 by claunia · 11 comments
Owner

Originally created by @escape0707 on GitHub (Aug 29, 2020).

Environment

Windows build number: Windows_NT x64 10.0.19041.0
Windows Terminal version: 1.2.2381.0 1.3.2382.0

Any other software? VSCode Version: 1.48.2

Steps to reproduce

  1. Try run Windows Terminal by Win + R: wt or by search terminal in start menu and run or click to run.
  2. try run nvim or get-help | less
  3. try Ctrl + , and launch VSCode. In VSCode integrated terminal, try step 2.

Expected behavior

Neovim launches or less launches.

Actual behavior

When using stable version of Windows Terminal, if run with wt, nvim and less won't give any output. This appies to the integrated terminal in a VSCode launches by pressing Ctrl + , in Windows Terminal, too.
But if I launch Windows Terminal in the same way as other UWP, there is no problem.

When using preview version of Windows Terminal, this problem only exist when run with wt and launch VSCode by Ctrl + ,, and then try nvim or less in VSCode's intergrated terminal.

Originally created by @escape0707 on GitHub (Aug 29, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Windows_NT x64 10.0.19041.0 Windows Terminal version: 1.2.2381.0 1.3.2382.0 Any other software? VSCode Version: 1.48.2 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> 1. Try run Windows Terminal by <kbd>Win</kbd> + <kbd>R</kbd>: `wt` or by search `terminal` in start menu and run or click to run. 2. try run `nvim` or `get-help | less` 3. try <kbd>Ctrl</kbd> + <kbd>,</kbd> and launch VSCode. In VSCode integrated terminal, try step 2. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Neovim launches or less launches. # Actual behavior <!-- What's actually happening? --> When using stable version of Windows Terminal, if run with `wt`, nvim and less won't give any output. This appies to the integrated terminal in a VSCode launches by pressing <kbd>Ctrl</kbd> + <kbd>,</kbd> in Windows Terminal, too. But if I launch Windows Terminal in the same way as other UWP, there is no problem. When using preview version of Windows Terminal, this problem only exist when run with `wt` and launch VSCode by <kbd>Ctrl</kbd> + <kbd>,</kbd>, and then try `nvim` or `less` in VSCode's intergrated terminal.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 02:20:05 +00:00
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Aug 29, 2020):

I think this is caused by https://github.com/microsoft/terminal/issues/7204. As a workaround, you could rename or delete the Path value (not the default value) at HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe.

When using preview version of Windows Terminal, this problem only exist when run with wt and launch VSCode by Ctrl + ,

https://github.com/microsoft/terminal/issues/7204 was fixed for the child processes that Windows Terminal starts for new tabs or panes, but Process Monitor shows that the Path change still leaks to the child process that Windows Terminal starts for editing the settings, and to C:\WINDOWS\system32\wsl.exe --list as well.

@KalleOlaviNiemitalo commented on GitHub (Aug 29, 2020): I think this is caused by <https://github.com/microsoft/terminal/issues/7204>. As a workaround, you could rename or delete the `Path` value (not the default value) at `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe` and `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe`. > When using preview version of Windows Terminal, this problem only exist when run with `wt` and launch VSCode by <kbd>Ctrl</kbd> + <kbd>,</kbd> <https://github.com/microsoft/terminal/issues/7204> was fixed for the child processes that Windows Terminal starts for new tabs or panes, but Process Monitor shows that the `Path` change still leaks to the child process that Windows Terminal starts for editing the settings, and to `C:\WINDOWS\system32\wsl.exe --list` as well.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Aug 29, 2020):

The Path change also propagates to the Web browser processes started by the Feedback menu item or by hyperlinks on the About screen.

I think it would be best to make wt.exe delete the installation directory from its in-process Path environment variable so that WindowsTerminal.exe never inherits it. That would prevent similar issues later in other features that start child processes.

@KalleOlaviNiemitalo commented on GitHub (Aug 29, 2020): The `Path` change also propagates to the Web browser processes started by the <samp>Feedback</samp> menu item or by hyperlinks on the <samp>About</samp> screen. I think it would be best to make `wt.exe` delete the installation directory from its in-process `Path` environment variable so that `WindowsTerminal.exe` never inherits it. That would prevent similar issues later in other features that start child processes.
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

I'd like to understand what part of having wt's application directory in PATH causes this. I can't reproduce it, and have never had an application fail to launch through WT unexpectedly.

What is your proposed method of action? @escape0707 you used the 👍 reaction on all of @KalleOlaviNiemitalo's comments; does that indicate that they fixed your issue?

@DHowett commented on GitHub (Sep 3, 2020): I'd like to understand what part of having wt's application directory in `PATH` causes this. I can't reproduce it, and have never had an application fail to launch through WT unexpectedly. What is your proposed method of action? @escape0707 you used the :+1: reaction on all of @KalleOlaviNiemitalo's comments; does that indicate that they fixed your issue?
Author
Owner

@escape0707 commented on GitHub (Sep 3, 2020):

@KalleOlaviNiemitalo @DHowett Thank you for all you guys' investigation.

Yes, @KalleOlaviNiemitalo's workaround fix that problem. I renamed those two Path in regedit.exe to Path1 and it works like expected, under both situations described in the original post.

I think it might worth noting that I installed VSCode-portable and Neovim through scoop package manager. But as I try to invoke nvim directly by it's absolute path and still failed, I think it at least might not be a scoop only problem. I also installed oh-my-posh and made my own $Profile but I ensured I had removed them and tested again before filed this issue.

Another note: For Windows Terminal Preview, there is no HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe, but change the other one is needed to workaround with this issue for me.

For this issue, I don't know where to find a proper log, as nvim just seems not being launched at all and no error message gived in terminal. VSCode-Vim do give an error as I enabled neovim for it and use nvim for neovim path. When this issue happens, VSCode gives this error when launched:

Configuration: Invalid neovimPath. Command failed: C:\Users\tothe\scoop\shims\nvim.exe 
--version.Tried to parse PATH C:\Users\tothe\scoop\shims\nvim.exe.
@escape0707 commented on GitHub (Sep 3, 2020): @KalleOlaviNiemitalo @DHowett Thank you for all you guys' investigation. Yes, @KalleOlaviNiemitalo's workaround fix that problem. I renamed those two `Path` in `regedit.exe` to `Path1` and it works like expected, under both situations described in the original post. I think it might worth noting that I installed VSCode-portable and Neovim through `scoop` package manager. But as I try to invoke `nvim` directly by it's absolute path and still failed, I think it at least might not be a `scoop` only problem. I also installed `oh-my-posh` and made my own `$Profile` but I ensured I had removed them and tested again before filed this issue. Another note: For Windows Terminal Preview, there is no `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe`, but change the other one is needed to workaround with this issue for me. For this issue, I don't know where to find a proper log, as `nvim` just seems not being launched at all and no error message gived in terminal. `VSCode-Vim` do give an error as I enabled neovim for it and use `nvim` for neovim path. When this issue happens, VSCode gives this error when launched: ```text Configuration: Invalid neovimPath. Command failed: C:\Users\tothe\scoop\shims\nvim.exe --version.Tried to parse PATH C:\Users\tothe\scoop\shims\nvim.exe. ```
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020):

I don't know how the extra entry in Path causes the error, but given the conditions in which the error does or doesn't occur, it must be involved. (Or perhaps Path just becomes too long overall?)

@escape0707, can you use Process Monitor to check what Scoop's wrapper or Neovim itself loads from the Windows Terminal directory?

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020): I don't know how the extra entry in `Path` causes the error, but given the conditions in which the error does or doesn't occur, it must be involved. (Or perhaps `Path` just becomes too long overall?) @escape0707, can you use [Process Monitor](https://docs.microsoft.com/sysinternals/downloads/procmon) to check what Scoop's wrapper or Neovim itself loads from the Windows Terminal directory?
Author
Owner

@escape0707 commented on GitHub (Sep 3, 2020):

@KalleOlaviNiemitalo Will this be useful?
Logfile.zip

I run Process Monitor and add Process Name is nvim.exe to filter, clicked Clear, Win+R wt, nvim + Enter. And got this.

@escape0707 commented on GitHub (Sep 3, 2020): @KalleOlaviNiemitalo Will this be useful? [Logfile.zip](https://github.com/microsoft/terminal/files/5166534/Logfile.zip) I run Process Monitor and add `Process Name is nvim.exe` to filter, clicked `Clear`, Win+R `wt`, `nvim` + Enter. And got this.
Author
Owner

@escape0707 commented on GitHub (Sep 3, 2020):

Logfile.zip
And this is what I set the filter to Parent PID is {WindowsTerminal.exe's PID}, Clear and run nvim got. Both this and the above post's log is for Windows Terminal, not the preview version.

@escape0707 commented on GitHub (Sep 3, 2020): [Logfile.zip](https://github.com/microsoft/terminal/files/5166567/Logfile.zip) And this is what I set the filter to `Parent PID is {WindowsTerminal.exe's PID}`, `Clear` and run `nvim` got. Both this and the above post's log is for Windows Terminal, not the preview version.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020):

From the logs, the problem seems related to vcruntime140.dll. The nvim.exe process manages to open C:\Users\tothe\scoop\apps\neovim\0.4.4\bin\vcruntime140.dll (a reparse point is involved) and calls NtCreateSection but then closes the file without a Load Image event. After that, it tries to open VCRUNTIME140.dll from several other directories. It successfully opens C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.2.2381.0_x64__8wekyb3d8bbwe\vcruntime140.dll for Read Attributes access but then gets an ACCESS DENIED error when trying to open that again for Execute access.

Can you also post a Process Monitor log of how nvim.exe starts successfully (e.g. in Windows Terminal Preview)?

Is C:\Users\tothe\scoop\apps\neovim\current a symbolic link or junction that points to C:\Users\tothe\scoop\apps\neovim\0.4.4?

Your computer does not appear to have C:\Windows\System32\VCRUNTIME140.dll. Perhaps installing Microsoft Visual C++ Redistributable would also work around this error, but similar errors might still occur with other DLLs.

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020): From the logs, the problem seems related to `vcruntime140.dll`. The `nvim.exe` process manages to open `C:\Users\tothe\scoop\apps\neovim\0.4.4\bin\vcruntime140.dll` (a reparse point is involved) and calls NtCreateSection but then closes the file without a Load Image event. After that, it tries to open `VCRUNTIME140.dll` from several other directories. It successfully opens `C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.2.2381.0_x64__8wekyb3d8bbwe\vcruntime140.dll` for Read Attributes access but then gets an ACCESS DENIED error when trying to open that again for Execute access. Can you also post a Process Monitor log of how `nvim.exe` starts successfully (e.g. in Windows Terminal Preview)? Is `C:\Users\tothe\scoop\apps\neovim\current` a symbolic link or junction that points to `C:\Users\tothe\scoop\apps\neovim\0.4.4`? Your computer does not appear to have `C:\Windows\System32\VCRUNTIME140.dll`. Perhaps installing [Microsoft Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) would also work around this error, but similar errors might still occur with other DLLs.
Author
Owner

@escape0707 commented on GitHub (Sep 3, 2020):

Logfile.zip

This is the successful run's log from Windows Terminal stable version invoked from Start menu app icon. And I followed your amazing way and discovered that this time neovim seems to be using python's vcruntime140.dll, which isn't what I expected...

C:\Users\tothe\scoop\apps\neovim\current is a symbolic link created by scoop to allow it to install, update and switch between each portable version of apps, etc. But I don't really understood too much of that.

I installed vcredist2019 and it works for Win+R+wt enviroment now. Thanks for your highly valuable time and effort! I literally have no experience about this kind of system and resources related problem.

I think I'll take care of installing vcredist later on when I use nvim or less on windows. And if this behavior is actually not a bug but expected consequence, maybe I should close this issue? I don't know it's because there is a reachable vcruntime140.dll provided by python added to the path that shadowed the fact of lacking a vcredist....

@escape0707 commented on GitHub (Sep 3, 2020): [Logfile.zip](https://github.com/microsoft/terminal/files/5166870/Logfile.zip) This is the successful run's log from Windows Terminal stable version invoked from Start menu app icon. And I followed your amazing way and discovered that this time neovim seems to be using python's `vcruntime140.dll`, which isn't what I expected... `C:\Users\tothe\scoop\apps\neovim\current` is a symbolic link created by `scoop` to allow it to install, update and switch between each portable version of apps, etc. But I don't really understood too much of that. I installed `vcredist2019` and it works for Win+R+`wt` enviroment now. Thanks for your highly valuable time and effort! I literally have no experience about this kind of system and resources related problem. I think I'll take care of installing vcredist later on when I use nvim or less on windows. And if this behavior is actually not a bug but expected consequence, maybe I should close this issue? I don't know it's because there is a reachable `vcruntime140.dll` provided by python added to the path that shadowed the fact of lacking a vcredist....
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020):

I think it's still a bug in Windows Terminal, which should not include its installation directory in the Path environment variable that child processes receive. Perhaps it's best to reopen https://github.com/microsoft/terminal/issues/7204 as https://github.com/microsoft/terminal/pull/7243 did not fix it for the settings editor and the about screen, and then close this one.

A separate bug report could be filed on Scoop, to let its maintainers investigate why the nvim.exe process tries to load vcruntime140.dll from Path even though it has a local C:\Users\tothe\scoop\apps\neovim\0.4.4\bin\vcruntime140.dll as well. Perhaps this is somehow caused by Scoop's symbolic link or by incorrect Authenticode signatures (a guess because NtCreateSection looked at HKLM\System\CurrentControlSet\Control\CI, i.e. Code Integrity).

@KalleOlaviNiemitalo commented on GitHub (Sep 3, 2020): I think it's still a bug in Windows Terminal, which should not include its installation directory in the `Path` environment variable that child processes receive. Perhaps it's best to reopen <https://github.com/microsoft/terminal/issues/7204> as <https://github.com/microsoft/terminal/pull/7243> did not fix it for the settings editor and the about screen, and then close this one. A separate bug report could be filed on Scoop, to let its maintainers investigate why the `nvim.exe` process tries to load `vcruntime140.dll` from `Path` even though it has a local `C:\Users\tothe\scoop\apps\neovim\0.4.4\bin\vcruntime140.dll` as well. Perhaps this is somehow caused by Scoop's symbolic link or by incorrect Authenticode signatures (a guess because NtCreateSection looked at `HKLM\System\CurrentControlSet\Control\CI`, i.e. Code Integrity).
Author
Owner

@escape0707 commented on GitHub (Sep 3, 2020):

I agree with you. I'll search in scoop repo for the dll problem later on and close this issue now.

@escape0707 commented on GitHub (Sep 3, 2020): I agree with you. I'll search in scoop repo for the dll problem later on and close this issue now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10383