macos: show quick terminal on undo/redo

This commit is contained in:
Mitchell Hashimoto
2025-06-07 13:13:57 -07:00
parent 6e77a5a6ca
commit 6f6d493763
2 changed files with 13 additions and 3 deletions

View File

@ -202,9 +202,19 @@ class QuickTerminalController: BaseTerminalController {
override func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) { override func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) {
super.surfaceTreeDidChange(from: from, to: to) super.surfaceTreeDidChange(from: from, to: to)
// If our surface tree is nil then we animate the window out. // If our surface tree is nil then we animate the window out. We
if (to.isEmpty) { // defer reinitializing the tree to save some memory here.
if to.isEmpty {
animateOut() animateOut()
return
}
// If we're not empty (e.g. this isn't the first set) and we're
// not visible, then we animate in. This allows us to show the quick
// terminal when things such as undo/redo are done.
if !from.isEmpty && !visible {
animateIn()
return
} }
} }

View File

@ -92,7 +92,7 @@ extension Ghostty {
return ghostty_surface_needs_confirm_quit(surface) return ghostty_surface_needs_confirm_quit(surface)
} }
// Retruns true if the process in this surface has exited. // Returns true if the process in this surface has exited.
var processExited: Bool { var processExited: Bool {
guard let surface = self.surface else { return true } guard let surface = self.surface else { return true }
return ghostty_surface_process_exited(surface) return ghostty_surface_process_exited(surface)