diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-11-11 12:55:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-11 12:55:28 +0000 |
commit | dba3cccf6948fb993e02d03ca8891fbc7f6cd3e6 (patch) | |
tree | f329f86bed6a185a8d7dc4b38bc13155071e6b9f /src/tty/unix.rs | |
parent | 021b424858d0b2fcf50c4199e152e93596cc8d5d (diff) | |
download | alacritty-dba3cccf6948fb993e02d03ca8891fbc7f6cd3e6.tar.gz alacritty-dba3cccf6948fb993e02d03ca8891fbc7f6cd3e6.zip |
Set env variables before window start
The environment variables specified in the configuration file are now
all set before the window is created. As a result, this makes it
possible to add the `WINIT_HIDPI_FACTOR` env variable directly to the
Alacritty configuration.
This fixes https://github.com/jwilm/alacritty/issues/1768.
Diffstat (limited to 'src/tty/unix.rs')
-rw-r--r-- | src/tty/unix.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/tty/unix.rs b/src/tty/unix.rs index 08a2c4f3..d6ab6a46 100644 --- a/src/tty/unix.rs +++ b/src/tty/unix.rs @@ -23,7 +23,6 @@ use cli::Options; use mio; use libc::{self, c_int, pid_t, winsize, SIGCHLD, TIOCSCTTY, WNOHANG}; -use terminfo::Database; use std::os::unix::io::{FromRawFd, RawFd}; use std::fs::File; @@ -241,29 +240,15 @@ pub fn new<T: ToWinsize>( builder.stderr(unsafe { Stdio::from_raw_fd(slave) }); builder.stdout(unsafe { Stdio::from_raw_fd(slave) }); - // Setup environment + // Setup shell environment builder.env("LOGNAME", pw.name); builder.env("USER", pw.name); builder.env("SHELL", shell.program()); builder.env("HOME", pw.dir); - // TERM; default to 'alacritty' if it is available, otherwise - // default to 'xterm-256color'. May be overridden by user's config - // below. - let term = if Database::from_name("alacritty").is_ok() { - "alacritty" - } else { - "xterm-256color" - }; - builder.env("TERM", term); - - builder.env("COLORTERM", "truecolor"); // advertise 24-bit support if let Some(window_id) = window_id { builder.env("WINDOWID", format!("{}", window_id)); } - for (key, value) in config.env().iter() { - builder.env(key, value); - } builder.before_exec(move || { // Create a new process group |