diff options
author | Christophe Verbinnen <christophe@verbinnen.org> | 2022-01-15 06:38:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 12:38:45 +0100 |
commit | 9cc2645db024df0a95efda42aed34bd3def19b28 (patch) | |
tree | d2345ca39dba0d5a2bf2cd7527799859147d6d69 /zellij-utils/src | |
parent | 6af419528f019ad603bedb8d0f564a569ba3e77a (diff) |
Add a copy command option (#996)
Usage: zellij options --copy-command "xclip -sel clip"
Co-authored-by: Christophe Verbinnen <christophev@knowbe4.com>
Diffstat (limited to 'zellij-utils/src')
-rw-r--r-- | zellij-utils/src/input/options.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs index dcaad306a..d8bef694b 100644 --- a/zellij-utils/src/input/options.rs +++ b/zellij-utils/src/input/options.rs @@ -74,6 +74,11 @@ pub struct Options { pub on_force_close: Option<OnForceClose>, #[structopt(long)] pub scroll_buffer_size: Option<usize>, + + /// Switch to using a user supplied command for clipboard instead of OSC52 + #[structopt(long)] + #[serde(default)] + pub copy_command: Option<String>, } impl Options { @@ -99,6 +104,7 @@ impl Options { let theme = other.theme.or_else(|| self.theme.clone()); let on_force_close = other.on_force_close.or(self.on_force_close); let scroll_buffer_size = other.scroll_buffer_size.or(self.scroll_buffer_size); + let copy_command = other.copy_command.or_else(|| self.copy_command.clone()); Options { simplified_ui, @@ -111,6 +117,7 @@ impl Options { mirror_session, on_force_close, scroll_buffer_size, + copy_command, } } @@ -140,6 +147,7 @@ impl Options { let theme = other.theme.or_else(|| self.theme.clone()); let on_force_close = other.on_force_close.or(self.on_force_close); let scroll_buffer_size = other.scroll_buffer_size.or(self.scroll_buffer_size); + let copy_command = other.copy_command.or_else(|| self.copy_command.clone()); Options { simplified_ui, @@ -152,6 +160,7 @@ impl Options { mirror_session, on_force_close, scroll_buffer_size, + copy_command, } } @@ -200,6 +209,7 @@ impl From<CliOptions> for Options { mirror_session: opts.mirror_session, on_force_close: opts.on_force_close, scroll_buffer_size: opts.scroll_buffer_size, + copy_command: opts.copy_command, } } } |