[PR #17750] Fix pane event handlers being unbound #31355

Open
opened 2026-01-31 09:46:44 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17750

State: closed
Merged: Yes


I don't know what has changed between #17450 and now, but that fix
doesn't seem necessary anymore. If you add this action:

{
    "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
**Original Pull Request:** https://github.com/microsoft/terminal/pull/17750 **State:** closed **Merged:** Yes --- 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 ✅
claunia added the pull-request label 2026-01-31 09:46:44 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31355