aboutsummaryrefslogtreecommitdiff
path: root/src/tty.rs
diff options
context:
space:
mode:
authorns <portification@gmail.com>2017-05-28 05:08:28 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2017-05-27 20:08:28 -0700
commitb9ec141c927b333bfea5d8a285deedd164181dd8 (patch)
tree4e585aee9265f8da68d039ab33d396882455be3d /src/tty.rs
parent0e4edc5420ee7e1d240980686ff0244d2627993d (diff)
downloadalacritty-b9ec141c927b333bfea5d8a285deedd164181dd8.tar.gz
alacritty-b9ec141c927b333bfea5d8a285deedd164181dd8.zip
Find and set $WINDOWID to X11 window ID (#586)
Diffstat (limited to 'src/tty.rs')
-rw-r--r--src/tty.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tty.rs b/src/tty.rs
index bd291b16..4f0aa1cf 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -174,7 +174,7 @@ fn get_pw_entry(buf: &mut [i8; 1024]) -> Passwd {
}
/// Create a new tty and return a handle to interact with it.
-pub fn new<T: ToWinsize>(config: &Config, options: &Options, size: T) -> Pty {
+pub fn new<T: ToWinsize>(config: &Config, options: &Options, size: T, window_id: Option<usize>) -> Pty {
let win = size.to_winsize();
let mut buf = [0; 1024];
let pw = get_pw_entry(&mut buf);
@@ -206,6 +206,9 @@ pub fn new<T: ToWinsize>(config: &Config, options: &Options, size: T) -> Pty {
builder.env("SHELL", shell.program());
builder.env("HOME", pw.dir);
builder.env("TERM", "xterm-256color"); // default term until we can supply our own
+ if let Some(window_id) = window_id {
+ builder.env("WINDOWID", format!("{}", window_id));
+ }
for (key, value) in config.env().iter() {
builder.env(key, value);
}