macOS: fix undo new tab will cause a crash

pull/9512/head
Lars 2025-11-07 15:19:13 +01:00 committed by Mitchell Hashimoto
parent 7f0468f910
commit 3f20f153c5
1 changed files with 8 additions and 3 deletions

View File

@ -377,9 +377,14 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
withTarget: controller,
expiresAfter: controller.undoExpiration
) { target in
// Close the tab when undoing
undoManager.disableUndoRegistration {
target.closeTab(nil)
// Close the tab when undoing. We do this in a DispatchQueue because
// for some people on macOS Tahoe this caused a crash and the queue
// fixes it.
// https://github.com/ghostty-org/ghostty/pull/9512
DispatchQueue.main.async {
undoManager.disableUndoRegistration {
target.closeTab(nil)
}
}
// Register redo action