diff --git a/src/input/Binding.zig b/src/input/Binding.zig index 0e2f929e5..6a66e1d6f 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -152,6 +152,9 @@ pub const Action = union(enum) { /// Clear the screen. This also clears all scrollback. clear_screen: void, + /// Select all text on the screen. + select_all: void, + /// Scroll the screen varying amounts. scroll_to_top: void, scroll_to_bottom: void, @@ -223,8 +226,6 @@ pub const Action = union(enum) { /// Quit ghostty quit: void, - select_all: void, - pub const CursorKey = struct { normal: []const u8, application: []const u8, diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 970f1b177..c441c14fb 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -1392,6 +1392,8 @@ pub fn clear(self: *Screen, mode: ClearMode) !void { } } +/// Return the selection for all contents on the screen. Surrounding +/// whitespace is omitted. If there is no selection, this returns null. pub fn selectAll(self: *Screen) ?Selection { const whitespace = &[_]u32{ 0, ' ', '\t' }; const y_max = self.rowsWritten() - 1;