summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz MikuĊ‚a <mati865@users.noreply.github.com>2020-09-01 00:30:45 +0200
committerGitHub <noreply@github.com>2020-08-31 22:30:45 +0000
commit5ee7ae8a274fcc58754aa5a91a14b1dedbb87583 (patch)
tree7d122c18517b119d8a4b3b99c337df4b889e5682
parentb39c791649e6d7409ad287741cfef962738c0fd4 (diff)
Disable WinPTY with windows-gnu toolchain
Co-authored-by: Christian Duerr <contact@christianduerr.com>
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/Cargo.toml5
-rw-r--r--alacritty_terminal/src/tty/windows/mod.rs14
3 files changed, 12 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9f09c9b..4e84ec91 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Minimum Rust version has been bumped to 1.43.0
- The snapcraft.yaml file has been removed
- Updated `setab`/`setaf` capabilities in `alacritty-direct` to use colons
+- WinPTY is now enabled only when targeting MSVC
### Added
diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml
index 7b11c1e1..7dfa5b09 100644
--- a/alacritty_terminal/Cargo.toml
+++ b/alacritty_terminal/Cargo.toml
@@ -28,7 +28,6 @@ nix = "0.17.0"
signal-hook = { version = "0.1", features = ["mio-support"] }
[target.'cfg(windows)'.dependencies]
-winpty = { version = "0.2.0", optional = true }
mio-named-pipes = "0.1"
miow = "0.3"
winapi = { version = "0.3.7", features = [
@@ -37,6 +36,10 @@ winapi = { version = "0.3.7", features = [
]}
mio-anonymous-pipes = "0.1"
+# Winpty crate supports only MSVC.
+[target.'cfg(all(target_os="windows", target_env="msvc"))'.dependencies]
+winpty = { version = "0.2.0", optional = true }
+
[features]
default = ["winpty"]
bench = []
diff --git a/alacritty_terminal/src/tty/windows/mod.rs b/alacritty_terminal/src/tty/windows/mod.rs
index 039dbaa6..27b65e58 100644
--- a/alacritty_terminal/src/tty/windows/mod.rs
+++ b/alacritty_terminal/src/tty/windows/mod.rs
@@ -10,19 +10,19 @@ use crate::term::SizeInfo;
use crate::tty::windows::child::ChildExitWatcher;
use crate::tty::{ChildEvent, EventedPty, EventedReadWrite};
-#[cfg(feature = "winpty")]
+#[cfg(all(feature = "winpty", target_env = "msvc"))]
mod automatic_backend;
mod child;
mod conpty;
-#[cfg(feature = "winpty")]
+#[cfg(all(feature = "winpty", target_env = "msvc"))]
mod winpty;
-#[cfg(not(feature = "winpty"))]
+#[cfg(not(all(feature = "winpty", target_env = "msvc")))]
use conpty::Conpty as Backend;
-#[cfg(not(feature = "winpty"))]
+#[cfg(not(all(feature = "winpty", target_env = "msvc")))]
use mio_anonymous_pipes::{EventedAnonRead as ReadPipe, EventedAnonWrite as WritePipe};
-#[cfg(feature = "winpty")]
+#[cfg(all(feature = "winpty", target_env = "msvc"))]
use automatic_backend::{
EventedReadablePipe as ReadPipe, EventedWritablePipe as WritePipe, PtyBackend as Backend,
};
@@ -39,12 +39,12 @@ pub struct Pty {
child_watcher: ChildExitWatcher,
}
-#[cfg(not(feature = "winpty"))]
+#[cfg(not(all(feature = "winpty", target_env = "msvc")))]
pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) -> Pty {
conpty::new(config, size, window_id).expect("Failed to create ConPTY backend")
}
-#[cfg(feature = "winpty")]
+#[cfg(all(feature = "winpty", target_env = "msvc"))]
pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) -> Pty {
automatic_backend::new(config, size, window_id)
}