From 6a627e2be70c5d903b0042ce140de4446ffd1705 Mon Sep 17 00:00:00 2001 From: Alex Pawlowski Date: Sun, 5 Dec 2021 15:39:13 -0500 Subject: [PATCH] Properly parse PATH on macOS This fixes Fish support Neovide is launched from Finder, as well as other non-standard configs where ~/.profile is missing --- src/main.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2de65f7..6581242 100644 --- a/src/main.rs +++ b/src/main.rs @@ -229,15 +229,11 @@ fn handle_macos() { use std::env; if env::var_os("TERM").is_none() { - let mut profile_path = dirs::home_dir().unwrap(); - profile_path.push(".profile"); let shell = env::var("SHELL").unwrap(); - let cmd = format!( - "(source /etc/profile && source {} && echo $PATH)", - profile_path.to_str().unwrap() - ); + let cmd = "printenv PATH"; + if let Ok(path) = std::process::Command::new(shell) - .arg("-c") + .arg("-lic") .arg(cmd) .output() {