diff --git a/CHANGES.md b/CHANGES.md index 7544b60..d13c464 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ CHANGES -------- +0.1.2 + +- Fix display issues when start from iTerm on MacOS. + 0.1.1 20190327 - Add `--nofork`. @@ -8,4 +12,4 @@ CHANGES 0.1.0 20190321 -- First release. +- First release. \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8224de5..f0ae578 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,6 +58,17 @@ fn check_alacritty() -> PathBuf { std::process::exit(-1); } +#[cfg(not(target_os = "macos"))] +fn prepare_env() { +} + +#[cfg(target_os = "macos")] +fn prepare_env() { + // When starting from iTerm, these env vars could cause some display issues. + env::remove_var("TERM_PROGRAM"); + env::remove_var("TERM_PROGRAM_VERSION"); +} + fn check_nvim() { let r = which(NVIM_NAME); if r == None { @@ -170,6 +181,7 @@ fn main() { command.arg(n_arg); } + prepare_env(); let mut child = command.spawn().unwrap(); if config.unwrap().fork { std::process::exit(0);