mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Merge pull request #2490 from futurepaul/quick-terminal-improvements
macos: quick terminal animate duration
This commit is contained in:
@ -197,7 +197,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
// Run the animation that moves our window into the proper place and makes
|
||||
// it visible.
|
||||
NSAnimationContext.runAnimationGroup({ context in
|
||||
context.duration = 0.2
|
||||
context.duration = ghostty.config.quickTerminalAnimationDuration
|
||||
context.timingFunction = .init(name: .easeIn)
|
||||
position.setFinal(in: window.animator(), on: screen)
|
||||
}, completionHandler: {
|
||||
@ -287,7 +287,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
}
|
||||
|
||||
NSAnimationContext.runAnimationGroup({ context in
|
||||
context.duration = 0.2
|
||||
context.duration = ghostty.config.quickTerminalAnimationDuration
|
||||
context.timingFunction = .init(name: .easeIn)
|
||||
position.setInitial(in: window.animator(), on: screen)
|
||||
}, completionHandler: {
|
||||
|
@ -354,6 +354,14 @@ extension Ghostty {
|
||||
let str = String(cString: ptr)
|
||||
return QuickTerminalScreen(fromGhosttyConfig: str) ?? .main
|
||||
}
|
||||
|
||||
var quickTerminalAnimationDuration: Double {
|
||||
guard let config = self.config else { return 0.2 }
|
||||
var v: Double = 0.2
|
||||
let key = "quick-terminal-animation-duration"
|
||||
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||
return v
|
||||
}
|
||||
#endif
|
||||
|
||||
var resizeOverlay: ResizeOverlay {
|
||||
|
@ -1270,6 +1270,11 @@ keybind: Keybinds = .{},
|
||||
/// by the operating system.
|
||||
@"quick-terminal-screen": QuickTerminalScreen = .main,
|
||||
|
||||
/// Duration (in seconds) of the quick terminal enter and exit animation.
|
||||
/// Set it to 0 to disable animation completely. This can be changed at
|
||||
/// runtime.
|
||||
@"quick-terminal-animation-duration": f64 = 0.2,
|
||||
|
||||
/// Whether to enable shell integration auto-injection or not. Shell integration
|
||||
/// greatly enhances the terminal experience by enabling a number of features:
|
||||
///
|
||||
|
Reference in New Issue
Block a user