macOS: fix undo new tab will cause a crash (#9512)
### Reproduce Steps on Tip (1.2.3 seems fine)
1. Open a new window.
2. Open a new tab.
3. **Wait for 2-3 seconds.**
4. Undo.
5. 💥
**RC is unclear for me, but dispatching it seems to fix it.**
pull/9415/merge
commit
fbabafe8e3
|
|
@ -377,9 +377,14 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
|
||||||
withTarget: controller,
|
withTarget: controller,
|
||||||
expiresAfter: controller.undoExpiration
|
expiresAfter: controller.undoExpiration
|
||||||
) { target in
|
) { target in
|
||||||
// Close the tab when undoing
|
// Close the tab when undoing. We do this in a DispatchQueue because
|
||||||
undoManager.disableUndoRegistration {
|
// for some people on macOS Tahoe this caused a crash and the queue
|
||||||
target.closeTab(nil)
|
// fixes it.
|
||||||
|
// https://github.com/ghostty-org/ghostty/pull/9512
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
undoManager.disableUndoRegistration {
|
||||||
|
target.closeTab(nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register redo action
|
// Register redo action
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue