mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
feat: add readonly surface mode
This commit is contained in:
committed by
Mitchell Hashimoto
parent
dd06d8a13b
commit
12bb2f3f47
@@ -552,6 +552,16 @@ pub const Action = union(enum) {
|
||||
/// reflect this by displaying an icon indicating the zoomed state.
|
||||
toggle_split_zoom,
|
||||
|
||||
/// Toggle read-only mode for the current surface.
|
||||
///
|
||||
/// When a surface is in read-only mode:
|
||||
/// - No input is sent to the PTY (mouse events, key encoding)
|
||||
/// - Input can still be used at the terminal level to make selections,
|
||||
/// copy/paste (keybinds), scroll, etc.
|
||||
/// - Warn before quit is always enabled in this state even if an active
|
||||
/// process is not running
|
||||
toggle_readonly,
|
||||
|
||||
/// Resize the current split in the specified direction and amount in
|
||||
/// pixels. The two arguments should be joined with a comma (`,`),
|
||||
/// like in `resize_split:up,10`.
|
||||
@@ -1241,6 +1251,7 @@ pub const Action = union(enum) {
|
||||
.new_split,
|
||||
.goto_split,
|
||||
.toggle_split_zoom,
|
||||
.toggle_readonly,
|
||||
.resize_split,
|
||||
.equalize_splits,
|
||||
.inspector,
|
||||
|
||||
@@ -485,6 +485,12 @@ fn actionCommands(action: Action.Key) []const Command {
|
||||
.description = "Toggle the zoom state of the current split.",
|
||||
}},
|
||||
|
||||
.toggle_readonly => comptime &.{.{
|
||||
.action = .toggle_readonly,
|
||||
.title = "Toggle Read-Only Mode",
|
||||
.description = "Toggle read-only mode for the current surface.",
|
||||
}},
|
||||
|
||||
.equalize_splits => comptime &.{.{
|
||||
.action = .equalize_splits,
|
||||
.title = "Equalize Splits",
|
||||
|
||||
Reference in New Issue
Block a user