aboutsummaryrefslogtreecommitdiff
path: root/src/tty/windows/mod.rs
diff options
context:
space:
mode:
authorDavid Hewitt <1939362+davidhewitt@users.noreply.github.com>2019-03-07 20:37:11 +0000
committerChristian Duerr <chrisduerr@users.noreply.github.com>2019-03-07 20:37:11 +0000
commitea87c1546b98265332239ccf6ff7eb45d7549ee2 (patch)
tree9b8cb69559008ddb5110f57e9c03ad52077d4e3b /src/tty/windows/mod.rs
parent9ba7c4fae4d927e109c7981f7e11ca7acdc14eb3 (diff)
downloadr-alacritty-ea87c1546b98265332239ccf6ff7eb45d7549ee2.tar.gz
r-alacritty-ea87c1546b98265332239ccf6ff7eb45d7549ee2.tar.bz2
r-alacritty-ea87c1546b98265332239ccf6ff7eb45d7549ee2.zip
Add dynamic title support for Window
Diffstat (limited to 'src/tty/windows/mod.rs')
-rw-r--r--src/tty/windows/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tty/windows/mod.rs b/src/tty/windows/mod.rs
index ae228bf3..5e0aee84 100644
--- a/src/tty/windows/mod.rs
+++ b/src/tty/windows/mod.rs
@@ -14,6 +14,7 @@
use std::io::{self, Read, Write};
use std::os::raw::c_void;
+use std::sync::atomic::{AtomicBool, Ordering};
use mio::{self, Evented, Poll, PollOpt, Ready, Token};
use mio_anonymous_pipes::{EventedAnonRead, EventedAnonWrite};
@@ -34,6 +35,7 @@ mod winpty;
/// Handle to the winpty agent or conpty process. Required so we know when it closes.
static mut HANDLE: *mut c_void = 0usize as *mut c_void;
+static IS_CONPTY: AtomicBool = AtomicBool::new(false);
pub fn process_should_exit() -> bool {
unsafe {
@@ -54,6 +56,10 @@ pub fn process_should_exit() -> bool {
}
}
+pub fn is_conpty() -> bool {
+ IS_CONPTY.load(Ordering::Relaxed)
+}
+
#[derive(Clone)]
pub enum PtyHandle<'a> {
Winpty(winpty::WinptyHandle<'a>),
@@ -86,6 +92,7 @@ pub fn new<'a>(
) -> Pty<'a> {
if let Some(pty) = conpty::new(config, options, size, window_id) {
info!("Using Conpty agent");
+ IS_CONPTY.store(true, Ordering::Relaxed);
pty
} else {
info!("Using Winpty agent");