[PR #17450] Fix crash when closing panes very quickly #31229

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

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

State: closed
Merged: Yes


#17358 introduced a bug where if you open/close panes very rapidly Terminal will crash. This was because _content was being set to null and then a Close event was being emitted, but several functions attempt to access the pane's _content as part of the close routine. For example, TerminalTab tries to update the TaskbarProgress every time a pane is closed and as part of that update sequence it queries the pane - which has null content now - for the taskbar progress, resulting in a crash. This PR fixes that crash.

Refs #17358

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17450 **State:** closed **Merged:** Yes --- #17358 introduced a bug where if you open/close panes very rapidly Terminal will crash. This was because `_content` was being set to `null` and then a `Close` event was being emitted, but several functions attempt to access the pane's `_content` as part of the close routine. For example, `TerminalTab` tries to update the `TaskbarProgress` every time a pane is closed and as part of that update sequence it queries the pane - which has `null` content now - for the taskbar progress, resulting in a crash. This PR fixes that crash. Refs #17358
claunia added the pull-request label 2026-01-31 09:45:56 +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#31229