diff --git a/Cargo.lock b/Cargo.lock index b7f0f387e5..736a32d094 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,6 +261,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "blocking" version = "1.0.2" @@ -351,6 +357,16 @@ dependencies = [ "vec_map", ] +[[package]] +name = "clipboard-win" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" +dependencies = [ + "lazy-bytes-cast", + "winapi", +] + [[package]] name = "close_fds" version = "0.3.2" @@ -415,6 +431,32 @@ dependencies = [ "winapi", ] +[[package]] +name = "copypasta" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" +dependencies = [ + "clipboard-win", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "x11-clipboard", +] + +[[package]] +name = "copypasta-ext" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc2f548212db51db2dba038e6e86c98a5d4a8ab0767ab230673a28be89a45b87" +dependencies = [ + "copypasta", + "libc", + "which", + "x11-clipboard", +] + [[package]] name = "cranelift-bforest" version = "0.68.0" @@ -697,6 +739,21 @@ dependencies = [ "winapi", ] +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading 0.7.2", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + [[package]] name = "dtoa" version = "0.4.8" @@ -1137,6 +1194,12 @@ dependencies = [ "log", ] +[[package]] +name = "lazy-bytes-cast" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1171,6 +1234,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "libloading" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + [[package]] name = "libssh2-sys" version = "0.2.23" @@ -1265,6 +1338,15 @@ dependencies = [ "libc", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "matches" version = "0.1.9" @@ -1286,6 +1368,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.4" @@ -1295,6 +1386,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -1354,6 +1451,19 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + [[package]] name = "nom" version = "5.1.2" @@ -1364,6 +1474,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "nom" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +dependencies = [ + "memchr", + "minimal-lexical", + "version_check", +] + [[package]] name = "ntapi" version = "0.3.6" @@ -1408,6 +1529,35 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "object" version = "0.22.0" @@ -1619,6 +1769,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "quick-xml" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.10" @@ -1892,6 +2051,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + [[package]] name = "scopeguard" version = "1.1.0" @@ -2003,6 +2168,34 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +[[package]] +name = "smithay-client-toolkit" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" +dependencies = [ + "bitflags", + "dlib", + "lazy_static", + "log", + "memmap2 0.3.1", + "nix 0.22.0", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + [[package]] name = "socket2" version = "0.4.2" @@ -2196,7 +2389,7 @@ checksum = "76971977e6121664ec1b960d1313aacfa75642adc93b9d4d53b247bd4cb1747e" dependencies = [ "dirs", "fnv", - "nom", + "nom 5.1.2", "phf", "phf_codegen", ] @@ -2631,7 +2824,7 @@ dependencies = [ "backtrace", "bincode", "lazy_static", - "memmap2", + "memmap2 0.2.3", "more-asserts", "rustc-demangle", "serde", @@ -2670,7 +2863,7 @@ dependencies = [ "bincode", "cfg-if 0.1.10", "leb128", - "libloading", + "libloading 0.6.7", "serde", "tempfile", "tracing", @@ -2769,6 +2962,79 @@ dependencies = [ "wast", ] +[[package]] +name = "wayland-client" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e256a731597b4e264d2f342e44f3708814103fbab144676fa077b6d9f3e2966" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.22.0", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96f28d05d154a6ae7a183f2d29906ccceae794047b3a97d35a627f483ed05ee2" +dependencies = [ + "nix 0.22.0", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb1afc06470809fea80281128ea2ed21b730589fe5f5ef0478eb8633bc1b003" +dependencies = [ + "nix 0.22.0", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b5199e12af7708dfb4eb6ea2f10b089d21b4b437cfde44b018ad11b093101b6" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cfd5edf014d2bcfd13607f6461acc15677676eeca58df0af7c4856be5faabf1" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.29.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb0eb50984d3efb0642b58ee2f458a62d765563bebd94049b6f9f40979f12aa" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.55" @@ -2821,6 +3087,41 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "x11-clipboard" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" +dependencies = [ + "xcb", +] + +[[package]] +name = "xcb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" +dependencies = [ + "libc", + "log", + "quick-xml", +] + +[[package]] +name = "xcursor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +dependencies = [ + "nom 7.1.0", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -2870,6 +3171,7 @@ dependencies = [ "cassowary", "chrono", "close_fds", + "copypasta-ext", "daemonize", "darwin-libproc", "highway", @@ -2919,7 +3221,7 @@ dependencies = [ "libc", "log", "log4rs", - "nix", + "nix 0.19.1", "once_cell", "serde", "serde_json", diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs index bc322e6a8e..1a26ca14f2 100644 --- a/default-plugins/status-bar/src/main.rs +++ b/default-plugins/status-bar/src/main.rs @@ -10,7 +10,8 @@ use zellij_tile_utils::style; use first_line::{ctrl_keys, superkey}; use second_line::{ - fullscreen_panes_to_hide, keybinds, locked_fullscreen_panes_to_hide, text_copied_hint, + fullscreen_panes_to_hide, keybinds, locked_fullscreen_panes_to_hide, system_clipboard_error, + text_copied_hint, }; use tip::utils::get_cached_tip_name; @@ -24,6 +25,7 @@ struct State { tip_name: String, mode_info: ModeInfo, diplay_text_copied_hint: bool, + display_system_clipboard_failure: bool, } register_plugin!(State); @@ -142,6 +144,7 @@ impl ZellijPlugin for State { EventType::TabUpdate, EventType::CopyToClipboard, EventType::InputReceived, + EventType::SystemClipboardFailure, ]); } @@ -156,8 +159,12 @@ impl ZellijPlugin for State { Event::CopyToClipboard => { self.diplay_text_copied_hint = true; } + Event::SystemClipboardFailure => { + self.display_system_clipboard_failure = true; + } Event::InputReceived => { self.diplay_text_copied_hint = false; + self.display_system_clipboard_failure = false; } _ => {} } @@ -188,12 +195,16 @@ impl ZellijPlugin for State { if t.is_fullscreen_active { second_line = if self.diplay_text_copied_hint { text_copied_hint(&self.mode_info.palette) + } else if self.display_system_clipboard_failure { + system_clipboard_error(&self.mode_info.palette) } else { fullscreen_panes_to_hide(&self.mode_info.palette, t.panes_to_hide) } } else { second_line = if self.diplay_text_copied_hint { text_copied_hint(&self.mode_info.palette) + } else if self.display_system_clipboard_failure { + system_clipboard_error(&self.mode_info.palette) } else { keybinds(&self.mode_info, &self.tip_name, cols) } @@ -203,6 +214,8 @@ impl ZellijPlugin for State { if t.is_fullscreen_active { second_line = if self.diplay_text_copied_hint { text_copied_hint(&self.mode_info.palette) + } else if self.display_system_clipboard_failure { + system_clipboard_error(&self.mode_info.palette) } else { locked_fullscreen_panes_to_hide( &self.mode_info.palette, @@ -212,6 +225,8 @@ impl ZellijPlugin for State { } else { second_line = if self.diplay_text_copied_hint { text_copied_hint(&self.mode_info.palette) + } else if self.display_system_clipboard_failure { + system_clipboard_error(&self.mode_info.palette) } else { keybinds(&self.mode_info, &self.tip_name, cols) } @@ -220,6 +235,8 @@ impl ZellijPlugin for State { _ => { second_line = if self.diplay_text_copied_hint { text_copied_hint(&self.mode_info.palette) + } else if self.display_system_clipboard_failure { + system_clipboard_error(&self.mode_info.palette) } else { keybinds(&self.mode_info, &self.tip_name, cols) } diff --git a/default-plugins/status-bar/src/second_line.rs b/default-plugins/status-bar/src/second_line.rs index 6f3c6461f9..32a444255c 100644 --- a/default-plugins/status-bar/src/second_line.rs +++ b/default-plugins/status-bar/src/second_line.rs @@ -241,6 +241,18 @@ pub fn text_copied_hint(palette: &Palette) -> LinePart { } } +pub fn system_clipboard_error(palette: &Palette) -> LinePart { + let hint = " Error using the system clipboard."; + let red_color = match palette.red { + PaletteColor::Rgb((r, g, b)) => RGB(r, g, b), + PaletteColor::EightBit(color) => Fixed(color), + }; + LinePart { + part: Style::new().fg(red_color).bold().paint(hint).to_string(), + len: hint.len(), + } +} + pub fn fullscreen_panes_to_hide(palette: &Palette, panes_to_hide: usize) -> LinePart { let white_color = match palette.white { PaletteColor::Rgb((r, g, b)) => RGB(r, g, b), diff --git a/zellij-server/Cargo.toml b/zellij-server/Cargo.toml index 8482b10f3d..85e8ff826e 100644 --- a/zellij-server/Cargo.toml +++ b/zellij-server/Cargo.toml @@ -27,6 +27,7 @@ log = "0.4.14" typetag = "0.1.7" chrono = "0.4.19" close_fds = "0.3.2" +copypasta-ext = "0.3.7" [target.'cfg(target_os = "macos")'.dependencies] darwin-libproc = "0.2.0" diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index cfc995186e..a0e65c7ed7 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -193,6 +193,7 @@ pub(crate) struct Screen { colors: Palette, draw_pane_frames: bool, session_is_mirrored: bool, + use_system_clipboard: bool, } impl Screen { @@ -204,6 +205,7 @@ impl Screen { mode_info: ModeInfo, draw_pane_frames: bool, session_is_mirrored: bool, + use_system_clipboard: bool, ) -> Self { Screen { bus, @@ -219,6 +221,7 @@ impl Screen { default_mode_info: mode_info, draw_pane_frames, session_is_mirrored, + use_system_clipboard, } } @@ -491,6 +494,7 @@ impl Screen { self.connected_clients.clone(), self.session_is_mirrored, client_id, + self.use_system_clipboard, ); tab.apply_layout(layout, new_pids, tab_index, client_id); if self.session_is_mirrored { @@ -692,6 +696,7 @@ pub(crate) fn screen_thread_main( ), draw_pane_frames, session_is_mirrored, + config_options.use_system_clipboard.unwrap_or(false), ); loop { let (event, mut err_ctx) = screen diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 40bb8e41ee..691667308d 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -39,6 +39,8 @@ use zellij_utils::{ pane_size::{Offset, PaneGeom, Size, Viewport}, }; +use copypasta_ext::display::DisplayServer; + // FIXME: This should be replaced by `RESIZE_PERCENT` at some point const MIN_TERMINAL_HEIGHT: usize = 5; const MIN_TERMINAL_WIDTH: usize = 5; @@ -119,6 +121,7 @@ pub(crate) struct Tab { session_is_mirrored: bool, pending_vte_events: HashMap>, selecting_with_mouse: bool, + use_system_clipboard: bool, } #[derive(Clone, Debug, Default, Serialize, Deserialize)] @@ -299,6 +302,7 @@ impl Tab { connected_clients_in_app: Rc>>, session_is_mirrored: bool, client_id: ClientId, + use_system_clipboard: bool, ) -> Self { let panes = BTreeMap::new(); @@ -335,6 +339,7 @@ impl Tab { connected_clients_in_app, connected_clients, selecting_with_mouse: false, + use_system_clipboard, } } @@ -1913,11 +1918,23 @@ impl Tab { fn write_selection_to_clipboard(&self, selection: &str) { let mut output = Output::default(); + let mut system_clipboard_failure = false; output.add_clients(&self.connected_clients); - output.push_str_to_multiple_clients( - &format!("\u{1b}]52;c;{}\u{1b}\\", base64::encode(selection)), - self.connected_clients.iter().copied(), - ); + if self.use_system_clipboard { + let res = DisplayServer::select() + .try_context() + .ok_or_else(|| "could not get clipboard provider".into()) + .and_then(|mut ctx| ctx.set_contents(selection.to_owned())); + + if res.is_err() { + system_clipboard_failure = true + } + } else { + output.push_str_to_multiple_clients( + &format!("\u{1b}]52;c;{}\u{1b}\\", base64::encode(selection)), + self.connected_clients.iter().copied(), + ); + } // TODO: ideally we should be sending the Render instruction from the screen self.senders @@ -1927,7 +1944,11 @@ impl Tab { .send_to_plugin(PluginInstruction::Update( None, None, - Event::CopyToClipboard, + if system_clipboard_failure { + Event::SystemClipboardFailure + } else { + Event::CopyToClipboard + }, )) .unwrap(); } diff --git a/zellij-server/src/tab/unit/tab_tests.rs b/zellij-server/src/tab/unit/tab_tests.rs index 13b971245d..88f872396a 100644 --- a/zellij-server/src/tab/unit/tab_tests.rs +++ b/zellij-server/src/tab/unit/tab_tests.rs @@ -96,6 +96,7 @@ fn create_new_tab(size: Size) -> Tab { let mut connected_clients = HashSet::new(); connected_clients.insert(client_id); let connected_clients = Rc::new(RefCell::new(connected_clients)); + let use_system_clipboard = false; let mut tab = Tab::new( index, position, @@ -110,6 +111,7 @@ fn create_new_tab(size: Size) -> Tab { connected_clients, session_is_mirrored, client_id, + use_system_clipboard, ); tab.apply_layout( LayoutTemplate::default().try_into().unwrap(), diff --git a/zellij-server/src/unit/screen_tests.rs b/zellij-server/src/unit/screen_tests.rs index ca34645df1..9a8282fd68 100644 --- a/zellij-server/src/unit/screen_tests.rs +++ b/zellij-server/src/unit/screen_tests.rs @@ -91,6 +91,7 @@ fn create_new_screen(size: Size) -> Screen { let mode_info = ModeInfo::default(); let draw_pane_frames = false; let session_is_mirrored = true; + let use_system_clipboard = false; Screen::new( bus, &client_attributes, @@ -98,6 +99,7 @@ fn create_new_screen(size: Size) -> Screen { mode_info, draw_pane_frames, session_is_mirrored, + use_system_clipboard, ) } diff --git a/zellij-tile/src/data.rs b/zellij-tile/src/data.rs index 36b44e25e0..e120748a2e 100644 --- a/zellij-tile/src/data.rs +++ b/zellij-tile/src/data.rs @@ -76,6 +76,7 @@ pub enum Event { Mouse(Mouse), Timer(f64), CopyToClipboard, + SystemClipboardFailure, InputReceived, Visible(bool), } diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs index dcaad306ab..1744e2f5c4 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, #[structopt(long)] pub scroll_buffer_size: Option, + + /// Switch to using xclip for clipboard instead of OSC52 + #[structopt(long)] + #[serde(default)] + pub use_system_clipboard: Option, } 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 use_system_clipboard = other.use_system_clipboard.or(self.use_system_clipboard); Options { simplified_ui, @@ -111,6 +117,7 @@ impl Options { mirror_session, on_force_close, scroll_buffer_size, + use_system_clipboard, } } @@ -133,6 +140,8 @@ impl Options { let mouse_mode = merge_bool(other.mouse_mode, self.mouse_mode); let pane_frames = merge_bool(other.pane_frames, self.pane_frames); let mirror_session = merge_bool(other.mirror_session, self.mirror_session); + let use_system_clipboard = + merge_bool(other.use_system_clipboard, self.use_system_clipboard); let default_mode = other.default_mode.or(self.default_mode); let default_shell = other.default_shell.or_else(|| self.default_shell.clone()); @@ -152,6 +161,7 @@ impl Options { mirror_session, on_force_close, scroll_buffer_size, + use_system_clipboard, } } @@ -200,6 +210,7 @@ impl From for Options { mirror_session: opts.mirror_session, on_force_close: opts.on_force_close, scroll_buffer_size: opts.scroll_buffer_size, + use_system_clipboard: opts.use_system_clipboard, } } }