core: slide terminal keybinding action

This commit is contained in:
Mitchell Hashimoto
2024-09-22 21:57:17 -07:00
parent d18e1c879b
commit cadb960ef9
5 changed files with 53 additions and 6 deletions

View File

@@ -3856,6 +3856,12 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
.toggle,
),
.toggle_slide_terminal => {
if (@hasDecl(apprt.Surface, "toggleSlideTerminal")) {
self.rt_surface.toggleSlideTerminal();
} else log.warn("runtime doesn't implement toggleSlideTerminal", .{});
},
.select_all => {
const sel = self.io.terminal.screen.selectAll();
if (sel) |s| {

View File

@@ -363,6 +363,17 @@ pub const Action = union(enum) {
/// This only works on macOS, since this is a system API on macOS.
toggle_secure_input: void,
/// Toggle the "slide" terminal. The slide terminal is a terminal that
/// slides in from some screen edge, usually the top. This is useful for
/// quick access to a terminal without having to open a new window or tab.
///
/// The slide terminal is a singleton; only one instance can exist at a
/// time.
///
/// See the various configurations for the slide terminal in the
/// configuration file to customize its behavior.
toggle_slide_terminal: void,
/// Quit ghostty.
quit: void,
@@ -382,6 +393,10 @@ pub const Action = union(enum) {
///
crash: CrashThread,
pub const SlideTerminalPosition = enum {
top,
};
pub const CrashThread = enum {
main,
io,