aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/main.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-04-28 20:21:39 +0000
committerGitHub <noreply@github.com>2019-04-28 20:21:39 +0000
commit9e89aaa477369b20a06f4b9f636d7fd543c4c985 (patch)
tree81deb1b250541a3c8fe7b6f9274f5a87f265a314 /alacritty/src/main.rs
parent37b66a7cd2e53fae93e3c2c8bc3ddbd9cbe140d2 (diff)
downloadr-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.tar.gz
r-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.tar.bz2
r-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.zip
Switch from copypasta to rust-clipboard
This switches our own `copypasta` crate with the more standardized `clipboard` library, which allows us to get rid of the `xclip` dependency on X11. Additionally, this lays the foundation for native Wayland clipboard support once the clipboard crate is updated (or a fork is created). Fixes #5.
Diffstat (limited to 'alacritty/src/main.rs')
-rw-r--r--alacritty/src/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs
index 7a200a8b..be512bee 100644
--- a/alacritty/src/main.rs
+++ b/alacritty/src/main.rs
@@ -41,6 +41,7 @@ use std::env;
#[cfg(not(windows))]
use std::os::unix::io::AsRawFd;
+use alacritty_terminal::clipboard::Clipboard;
use alacritty_terminal::config::{self, Config, Monitor};
use alacritty_terminal::display::Display;
use alacritty_terminal::event_loop::{self, EventLoop, Msg};
@@ -138,12 +139,18 @@ fn run(
info!("PTY Dimensions: {:?} x {:?}", display.size().lines(), display.size().cols());
+ // Create new native clipboard
+ #[cfg(not(any(target_os = "macos", target_os = "windows")))]
+ let clipboard = Clipboard::new(display.get_wayland_display());
+ #[cfg(any(target_os = "macos", target_os = "windows"))]
+ let clipboard = Clipboard::new();
+
// Create the terminal
//
// This object contains all of the state about what's being displayed. It's
// wrapped in a clonable mutex since both the I/O loop and display need to
// access it.
- let terminal = Term::new(&config, display.size().to_owned(), message_buffer);
+ let terminal = Term::new(&config, display.size().to_owned(), message_buffer, clipboard);
let terminal = Arc::new(FairMutex::new(terminal));
// Find the window ID for setting $WINDOWID