[PR #7961] Fix crash when creating tab menu multiple times #27040

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

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

State: closed
Merged: Yes


Fix for crash occurring when splitting a pane, due to tab context menu created multiple times.

References

#7728

PR Checklist

Detailed Description of the Pull Request / Additional comments

When splitting panes the Tab::Initialize function is called again. This rebuilt the context menu from scratch and appended the existing Close... sub-menu items to a new parent, thus causing the crash.
It is not necessary to re-create the context menu every time you split panes, it can be created only once.

Validation Steps Performed

Manual verification:

  • Play with the context menu, the Close... submenu is functioning
  • Split panes (ALT + New tab), no crash occurs and context menu still functioning
**Original Pull Request:** https://github.com/microsoft/terminal/pull/7961 **State:** closed **Merged:** Yes --- Fix for crash occurring when splitting a pane, due to tab context menu created multiple times. ## References #7728 ## PR Checklist * [x] Closes #7941 * [x] CLA signed. ## Detailed Description of the Pull Request / Additional comments When splitting panes the `Tab::Initialize` function is called again. This rebuilt the context menu from scratch and appended the existing Close... sub-menu items to a new parent, thus causing the crash. It is not necessary to re-create the context menu every time you split panes, it can be created only once. ## Validation Steps Performed Manual verification: - Play with the context menu, the Close... submenu is functioning - Split panes (ALT + New tab), no crash occurs and context menu still functioning
claunia added the pull-request label 2026-01-31 09:19:38 +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#27040