mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
config: add clipboard-paste-bracketed-safe
This commit is contained in:
@ -143,6 +143,7 @@ const DerivedConfig = struct {
|
|||||||
clipboard_write: bool,
|
clipboard_write: bool,
|
||||||
clipboard_trim_trailing_spaces: bool,
|
clipboard_trim_trailing_spaces: bool,
|
||||||
clipboard_paste_protection: bool,
|
clipboard_paste_protection: bool,
|
||||||
|
clipboard_paste_bracketed_safe: bool,
|
||||||
copy_on_select: configpkg.CopyOnSelect,
|
copy_on_select: configpkg.CopyOnSelect,
|
||||||
confirm_close_surface: bool,
|
confirm_close_surface: bool,
|
||||||
mouse_interval: u64,
|
mouse_interval: u64,
|
||||||
@ -167,6 +168,7 @@ const DerivedConfig = struct {
|
|||||||
.clipboard_write = config.@"clipboard-write",
|
.clipboard_write = config.@"clipboard-write",
|
||||||
.clipboard_trim_trailing_spaces = config.@"clipboard-trim-trailing-spaces",
|
.clipboard_trim_trailing_spaces = config.@"clipboard-trim-trailing-spaces",
|
||||||
.clipboard_paste_protection = config.@"clipboard-paste-protection",
|
.clipboard_paste_protection = config.@"clipboard-paste-protection",
|
||||||
|
.clipboard_paste_bracketed_safe = config.@"clipboard-paste-bracketed-safe",
|
||||||
.copy_on_select = config.@"copy-on-select",
|
.copy_on_select = config.@"copy-on-select",
|
||||||
.confirm_close_surface = config.@"confirm-close-surface",
|
.confirm_close_surface = config.@"confirm-close-surface",
|
||||||
.mouse_interval = config.@"click-repeat-interval" * 1_000_000, // 500ms
|
.mouse_interval = config.@"click-repeat-interval" * 1_000_000, // 500ms
|
||||||
@ -2514,7 +2516,7 @@ fn completeClipboardPaste(
|
|||||||
//
|
//
|
||||||
// We do not do this for bracketed pastes because bracketed pastes are
|
// We do not do this for bracketed pastes because bracketed pastes are
|
||||||
// by definition safe since they're framed.
|
// by definition safe since they're framed.
|
||||||
if (!bracketed and
|
if ((!self.config.clipboard_paste_bracketed_safe or !bracketed) and
|
||||||
self.config.clipboard_paste_protection and
|
self.config.clipboard_paste_protection and
|
||||||
!allow_unsafe and
|
!allow_unsafe and
|
||||||
!terminal.isSafePaste(data))
|
!terminal.isSafePaste(data))
|
||||||
|
@ -430,6 +430,12 @@ keybind: Keybinds = .{},
|
|||||||
/// This currently only works on Linux (GTK).
|
/// This currently only works on Linux (GTK).
|
||||||
@"clipboard-paste-protection": bool = true,
|
@"clipboard-paste-protection": bool = true,
|
||||||
|
|
||||||
|
/// If true, bracketed pastes will be considered safe. By default,
|
||||||
|
/// bracketed pastes are considered safe. "Bracketed" pastes are pastes
|
||||||
|
/// while the running program has bracketed paste mode enabled (a setting
|
||||||
|
/// set by the running program, not the terminal emulator).
|
||||||
|
@"clipboard-paste-bracketed-safe": bool = true,
|
||||||
|
|
||||||
/// The total amount of bytes that can be used for image data (i.e.
|
/// The total amount of bytes that can be used for image data (i.e.
|
||||||
/// the Kitty image protocol) per terminal scren. The maximum value
|
/// the Kitty image protocol) per terminal scren. The maximum value
|
||||||
/// is 4,294,967,295 (4GB). The default is 320MB. If this is set to zero,
|
/// is 4,294,967,295 (4GB). The default is 320MB. If this is set to zero,
|
||||||
|
Reference in New Issue
Block a user