diff options
Diffstat (limited to 'src/term')
| -rw-r--r-- | src/term/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 72d97ed9..e43ea7b6 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -29,6 +29,7 @@ use index::{self, Point, Column, Line, Linear, IndexRange, Contains, RangeInclus use selection::{self, Span, Selection}; use config::{Config, VisualBellAnimation}; use {MouseCursor, Rgb}; +use copypasta::{Clipboard, Load, Store}; pub mod cell; pub mod color; @@ -1673,6 +1674,17 @@ impl ansi::Handler for Term { self.color_modified[index] = false; } + /// Set the clipboard + #[inline] + fn set_clipboard(&mut self, string: &str) + { + Clipboard::new() + .and_then(|mut clipboard| clipboard.store_primary(string)) + .unwrap_or_else(|err| { + warn!("Error storing selection to clipboard. {}", err); + }); + } + #[inline] fn clear_screen(&mut self, mode: ansi::ClearMode) { trace!("clear_screen: {:?}", mode); |