-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 in focus mode causes terminal to become unresponsive #7916
Comments
@zadjii-msft - there is an "event handling catastrophe here" 😄. Closing the tab triggers two actions - shutting the existing tab down and moving the focus to the next tab. And then comes a _MoveFocus that invokes _UnzoomIfNeeded that in the focus mode calls activeTab->ExitZoom(), that invokes activePane->Restore, that access _firstChild and _secondChild that might be null already |
Oh yeah, we have a number of event handling catastrophies in our code. |
@zadjii-msft - and if this is not enough there are a lot of "funny" races. E.g., Exit Zoom might be called twice. From one hand it is called from _MoveFocus->_UnzoomIfNeeded
On the other hand it might get called from
This is funny because the co_await in the last one will allow both functions to enter ExitZoom |
I am not sure where to start from. The immediate mitigation that will hopefully help is to check all pointers against nulls in the Restore method (zommedPane, firstChild and secondChild). |
In any case the issue I described is irrelevant for this one. Here the closed tab is not multipane, and it should be something else. |
Hi! I was about to post a new issue but I think this issue is similar so I thought I would add it here instead. Windows details:
Problem description: I've set focus mode to be my default. My default profile is powershell but often I open wt for WSL. My natural workflow would thus be:
Expected behavior: Tab 1 (PS) closes, Tab 2 (WSL) remains open Actual behavior: The whole app closes silently. I am not sure if it crashes or the program simply exits. |
🎉This issue was addressed in #8549, which has now been successfully released as Handy links: |
## PR Checklist * [x] Closes microsoft#7916 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments Upon tab close the tabview is responsible to issue tab selection for the next active tab. However this doesn't happen when tabview is hidden. There was a special treatment for this scenario for full screen mode. Added the same treatment to focus mode (as the tabview is not visible in this case as well). ## Validation Steps Performed Manual tests
But it probably repros for something simpler
4. Close the first tab
expected
The tab closes, and the terminal works as usual
actual
The tab stays open, and now the terminal is seemingly hung. The focus has left the original control, but hasn't gone anywhere. There's no tab strip to be able to manually focus another tab. Clicking the control also doesn't focus it. Since the focused control is responsible for routing keyboard events, the terminal won't respond to any KB shortcuts, since there's no focused control
The text was updated successfully, but these errors were encountered: