Skip to content

Commit

Permalink
Fix display issues when start from iTerm
Browse files Browse the repository at this point in the history
  • Loading branch information
beeender committed Apr 9, 2019
1 parent 2e4a2a1 commit 0d52ae9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
CHANGES
--------

0.1.2

- Fix display issues when start from iTerm on MacOS.

0.1.1 20190327

- Add `--nofork`.


0.1.0 20190321

- First release.
- First release.
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0d52ae9

Please sign in to comment.