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;
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()
{

Loading…
Cancel
Save