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

Sporadic cannot ctrl+D to or enter to close the terminal #17578

Closed
dovholuknf opened this issue Jul 17, 2024 · 7 comments · Fixed by #17750
Closed

Sporadic cannot ctrl+D to or enter to close the terminal #17578

dovholuknf opened this issue Jul 17, 2024 · 7 comments · Fixed by #17750
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Terminal The new Windows Terminal.

Comments

@dovholuknf
Copy link

dovholuknf commented Jul 17, 2024

Windows Terminal version

Version: 1.21.1772.0

Windows build number

Microsoft Windows [Version 10.0.22631.3880]

Other Software

N/A

Steps to reproduce

No idea how to reproduce. Sometimes, after a long time open and running I notice the "track my mouse" feature stops working between panes and then when i exit the terminal it ends up printing:

[process exited with code 130 (0x00000082)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

but ctrl+d or enter don't exit the pane:
terminal-pane-example

Expected Behavior

I want the "track my mouse" feature to keep working and if i have to close the terminal, i expect the pane to actually close.

Actual Behavior

mouse tracking fails and ctrl+d/enter won't actually close the pane. the whole terminal window needs to be relaunched.

@dovholuknf dovholuknf added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 17, 2024
@carlos-zamora carlos-zamora added Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. Priority-2 A description (P2) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 24, 2024
@carlos-zamora carlos-zamora added this to the Terminal v1.22 milestone Jul 24, 2024
@dovholuknf
Copy link
Author

I can't reproduce it on demand but it keeps happening. i did however go back to the released Version: 1.20.11781.0 and this is not a problem. I've moved away from the 'preview' for now because of this issue.

It might have to do with mouse tracking. Another example of how the mouse tracking seems to have failed and when i exit the terminal i get the Ctrl+D message

track

@dovholuknf
Copy link
Author

CTRL-D doesn't close the window either on the preview version. I can confirm that the 'stable' terminal 1.20.11781.0 properly responds to CTRL-D and closes the pane

@vefatica
Copy link

I can repro (every time) like this.

Start WT normally (one tab, normal window).
Go full-screen (F11).
Split vertical (Alt+Shift++)
"exit" the shell on the right (this is OK)
"exit" the remaining shell (error occurs)

Note that exiting the lefthand shell then the other one does not cause the error.

Ditto for Split Horizontal with "bottom" replacing "right" and the analogous note about which is exitted first.

@vefatica
Copy link

It happens in WindowsTerminal 1.21.2406.25002 (preview) and not in WindowsTerminal 1.20.2406.26001.

@lhecker
Copy link
Member

lhecker commented Aug 20, 2024

This regressed in 5d46e31. Because the content isn't being reset anymore, after a split-pane two panes may share the same content object. Closing one pane will then cause both to be closed.

@vefatica
Copy link

@lhecker, If I understand your comment correctly (which may not be the case), then I don't see that. In my experiment, closing either pane leaves the other pane functional. As noted before, closing the new pane causes the original pane to exhibit the problem under discussion when it's closed. But closing the original pane does not cause the new pane to exhibit the problem when it's closed.

@lhecker
Copy link
Member

lhecker commented Aug 20, 2024

When I said "closed" I was referring to an internal function called "Close" that removes some event handlers from the "content" of a pane. This is what causes Ctrl-D and Enter to seemingly not work. (It was confusingly worded. I'm sorry. 😣)

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Aug 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Aug 21, 2024
DHowett pushed a commit that referenced this issue Aug 21, 2024
I don't know what has changed between #17450 and now, but that fix
doesn't seem necessary anymore. If you add this action:
```json
{
    "keys": "ctrl+a",
    "command":
    {
        "action": "splitPane",
        "commandline": "cmd /c exit"
    }
}
```

and repeatedly spam Ctrl-A it used to lead to crashes. That doesn't
happen anymore, because some other PR must've fixed that.

Reverting #17450 fixes the issue found in #17578: Because the content
pointer didn't get reset to null anymore it meant that the root
pane retained the pointer after a split. After closing the split off
pane, it would assign the remaining one back to the root, which would
cause the still existing content pointer to be closed. That pointer
is potentially the same as the remaining pane and so no close events
would get received anymore.

Closes #17578

## Validation Steps Performed
* Add the above action and spam it ✅
* Start with an empty window, split pane, type `exit` in the new pane
  then type it in the original pane. It closes the window ✅

(cherry picked from commit 056af83)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCfE
Service-Version: 1.21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants