aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
authorZac Pullar-Strecker <zacps@users.noreply.github.com>2018-10-17 06:02:52 +1300
committerJoe Wilm <jwilm@users.noreply.github.com>2018-10-16 10:02:52 -0700
commit15e0deae2b49078b47a782679300cdf99d9ce687 (patch)
tree8175fbed0def1af08cd2db41583975adbb27dff1 /src/input.rs
parentb41c6b736d67d61e92b174dfea58ae46813934cd (diff)
downloadalacritty-15e0deae2b49078b47a782679300cdf99d9ce687.tar.gz
alacritty-15e0deae2b49078b47a782679300cdf99d9ce687.zip
Add support for Windows (#1374)
Initial support for Windows is implemented using the winpty translation layer. Clipboard support for Windows is provided through the `clipboard` crate, and font rasterization is provided by RustType. The tty.rs file has been split into OS-specific files to separate standard pty handling from the winpty implementation. Several binary components are fetched via build script on windows including libclang and winpty. These could be integrated more directly in the future either by building those dependencies as part of the Alacritty build process or by leveraging git lfs to store the artifacts. Fixes #28.
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/input.rs b/src/input.rs
index cc3f13df..6d3b407a 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -22,6 +22,7 @@ use std::borrow::Cow;
use std::mem;
use std::process::Command;
use std::time::Instant;
+#[cfg(not(windows))]
use std::os::unix::process::CommandExt;
use copypasta::{Clipboard, Load, Buffer as ClipboardBuffer};
@@ -232,7 +233,9 @@ impl Action {
},
Action::Command(ref program, ref args) => {
trace!("running command: {} {:?}", program, args);
- match Command::new(program)
+
+ #[cfg(not(windows))]
+ let spawned = Command::new(program)
.args(args)
.before_exec(|| {
// Detach forked process from Alacritty. This will cause
@@ -240,7 +243,14 @@ impl Action {
unsafe { ::libc::daemon(1, 0); }
Ok(())
})
- .spawn()
+ .spawn();
+
+ #[cfg(windows)]
+ let spawned = Command::new(program)
+ .args(args)
+ .spawn();
+
+ match spawned
{
Ok(child) => {
debug!("spawned new proc with pid: {}", child.id());