mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
macos: show quick terminal on undo/redo
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user