diff options
author | ns <portification@gmail.com> | 2017-05-28 05:08:28 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-05-27 20:08:28 -0700 |
commit | b9ec141c927b333bfea5d8a285deedd164181dd8 (patch) | |
tree | 4e585aee9265f8da68d039ab33d396882455be3d /src/tty.rs | |
parent | 0e4edc5420ee7e1d240980686ff0244d2627993d (diff) | |
download | alacritty-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.rs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } |