After few hours externals command are executed externally #9187

Closed
opened 2026-01-31 01:48:13 +00:00 by claunia · 6 comments
Owner

Originally created by @sbugalski on GitHub (Jun 21, 2020).

Environment

Windows build number: Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18363.0 Microsoft Windows NT 10.0.18363.0
Windows Terminal version (if applicable):

Any other software: Az CLI, Kubectl, chocolatey

Steps to reproduce

  • Run Windows Terminal with Windows Powershell
❯ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.
  • Use it for long time
  • Execute external program (like az, kubectl)

Expected behavior

Run application in command line

Actual behavior

  • It pops out application in external process.
    Hv0EektpEX
    When run in new tab it works as expected
Originally created by @sbugalski on GitHub (Jun 21, 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: Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0 Windows Terminal version (if applicable): Any other software: Az CLI, Kubectl, chocolatey ``` # Steps to reproduce * Run Windows Terminal with Windows Powershell ``` ❯ $PSVersionTable Name Value ---- ----- PSVersion 5.1.18362.752 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.18362.752 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0. ``` * Use it for long time * Execute external program (like az, kubectl) # Expected behavior Run application in command line # Actual behavior * It pops out application in external process. ![Hv0EektpEX](https://user-images.githubusercontent.com/45152735/85225752-a707d080-b3d3-11ea-9e96-71cd891264a6.png) When run in new tab it works as expected
Author
Owner

@zadjii-msft commented on GitHub (Jun 22, 2020):

what

I have no idea how this would happen. Maybe there's something bugged in powershell that's causing it to start running commands in another window always?

Does it usually start happening after running a specific command? Or a sequence of commands?

@zadjii-msft commented on GitHub (Jun 22, 2020): _what_ I have no idea how this would happen. Maybe there's something bugged in powershell that's causing it to start running commands in another window always? Does it usually start happening after running a specific command? Or a sequence of commands?
Author
Owner

@tamlin-mike commented on GitHub (Jun 22, 2020):

@sbugalski Please check HANDLE counts (using e.g. TaskMgr) next time this happens. USER handles could be a prime suspect.

@zadjii-msft I suspect there's a leak (probably a HWND) in the window-hosting. I believe it would perfectly match that bug behavior.

@tamlin-mike commented on GitHub (Jun 22, 2020): @sbugalski Please check HANDLE counts (using e.g. TaskMgr) next time this happens. USER handles could be a prime suspect. @zadjii-msft I suspect there's a leak (probably a HWND) in the window-hosting. I believe it would perfectly match that bug behavior.
Author
Owner

@DHowett commented on GitHub (Jun 22, 2020):

@tamlin-mike the Terminal doesn’t host console windows inside it; it uses the pseudoconsole API which communicates process state over a pair of pipes. There isn’t an HWND in sight :)

@DHowett commented on GitHub (Jun 22, 2020): @tamlin-mike the Terminal doesn’t host console windows inside it; it uses the pseudoconsole API which communicates process state over a pair of pipes. There isn’t an HWND in sight :)
Author
Owner

@tamlin-mike commented on GitHub (Jun 22, 2020):

@DHowett Damn, there goes that theory. :-)

It still has a strong smell of resource leak though, or table overflow, plus some lack of error checking for function returns (otherwise some code would have caught this and reported error, right? :-) ).

Could it be a pipe leak (DuplicateHandle, impersonation, ...)? Leak or race in the pseudoconsole API implementation?

@tamlin-mike commented on GitHub (Jun 22, 2020): @DHowett Damn, there goes that theory. :-) It still has a strong smell of resource leak though, or table overflow, plus some lack of error checking for function returns (otherwise some code would have caught this and reported error, right? :-) ). Could it be a pipe leak (`DuplicateHandle`, impersonation, ...)? Leak or race in the pseudoconsole API implementation?
Author
Owner

@sbugalski commented on GitHub (Jun 24, 2020):

Does it usually start happening after running a specific command? Or a sequence of commands?
@zadjii-msft:
It happened me twice, I was using kubectl and az cli mainly.

@sbugalski Please check HANDLE counts (using e.g. TaskMgr) next time this happens. USER handles could be a prime suspect.
@tamlin-mike
Sure, once it happens me again I'll check that.

@sbugalski commented on GitHub (Jun 24, 2020): > Does it usually start happening after running a specific command? Or a sequence of commands? @zadjii-msft: It happened me twice, I was using kubectl and az cli mainly. > @sbugalski Please check HANDLE counts (using e.g. TaskMgr) next time this happens. USER handles could be a prime suspect. @tamlin-mike Sure, once it happens me again I'll check that.
Author
Owner

@ghost commented on GitHub (Jun 30, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jun 30, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9187