Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing a tab doesn't terminate its associated process(es) #541

Closed
0xabu opened this issue May 7, 2019 · 7 comments
Closed

Closing a tab doesn't terminate its associated process(es) #541

0xabu opened this issue May 7, 2019 · 7 comments
Labels
Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@0xabu
Copy link

0xabu commented May 7, 2019

When I close a tab (either via Ctrl-W or the close gadget), the underlying processes don't seem to be terminated. For example, this is what task manager shows if I've opened a few tabs and closed them:
image
At the time I took this screenshot, there was only a single tab open.

  • Your Windows build number: 18362
@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented May 8, 2019 via email

@DHowett-MSFT DHowett-MSFT added Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Issue-Bug It either shouldn't be doing this or needs an investigation. labels May 9, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@shuffle2
Copy link

shuffle2 commented Jun 2, 2019

Was just making new issue, but noticed this one.

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.145]
Windows Terminal version (if applicable): 880272c7483a3bb6893dbec3725d0eb7375ab78a

Steps to reproduce

Watch WindowsTerminal in procexp or something. Open and close tabs. Spawned processes are never killed until WindowsTerminal.exe is.

Expected behavior

The code attempts to close spawned processes with tabs, but there are some refcount leaks on a shared_ptr.

Actual behavior

Reference of newly created tab is given to 2 lambdas, which never die. It seems the API gives back a handle which you're supposed to use to remove the callback, which isn't currently done.
https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/App.cpp#L765
https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/App.cpp#L786

@DHowett-MSFT
Copy link
Contributor

There's also some process isolation issues that result in console hosts sticking around after WT exits; #970 seeks to fix some of that.

@zadjii-msft
Copy link
Member

@shuffle2 god find on those lines. I think I touched those in #825, but this issue will be helpful to make sure that those are fixed correctly.

@zadjii-msft
Copy link
Member

Hey this was fixed in #541! Hooray!

Its also related to #745

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jun 10, 2019
@zadjii-msft zadjii-msft added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jun 10, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 10, 2019
@ms-xy
Copy link

ms-xy commented Nov 16, 2021

I want to report that this is still an issue. It is impossible to terminate a misbehaving child process without terminating the terminal in the process.

Example situation: I start a wildfly server. After a while it becomes unresponsive. I close the tab, but the process lingers and is not terminated, blocking ports. If I try to end the process via task manager, it also terminates the parent process, effectively closing all my other tabs. Which in turn renders the tab feature pretty much useless.

@zadjii-msft
Copy link
Member

@ms-xy This was a bug with a pretty specific root cause more than two years ago now - if you're seeing something similar, it's likely a new bug entirely. Mind filing a new issue? Knowing more about your exact setup might help debug & root-cause what you're seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

6 participants