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
macos-click-through
Alex Pawlowski 3 years ago committed by Keith Simmons
parent ef8a95a91d
commit 6a627e2be7

@ -229,15 +229,11 @@ fn handle_macos() {
use std::env; use std::env;
if env::var_os("TERM").is_none() { 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 shell = env::var("SHELL").unwrap();
let cmd = format!( let cmd = "printenv PATH";
"(source /etc/profile && source {} && echo $PATH)",
profile_path.to_str().unwrap()
);
if let Ok(path) = std::process::Command::new(shell) if let Ok(path) = std::process::Command::new(shell)
.arg("-c") .arg("-lic")
.arg(cmd) .arg(cmd)
.output() .output()
{ {

Loading…
Cancel
Save