https://github.com/tauri-apps/fix-path-env-rs.git
A Rust crate to fix the PATH environment variable on Windows, macOS, and Linux when running a GUI app.
GUI apps have different PATH inheritance issues on different platforms:
std::process::Command sometimes doesn't inherit the parent process's PATH$PATH from your shell dotfiles (.bashrc, .bash_profile, .zshrc, etc)Cargo.toml.
[dependencies]
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }
fix_path_env::fix() as early as possible in your main function in main.rs file
fn main() {
let _ = fix_path_env::fix(); // <---- Add this
}
std::process::Command where child processes sometimes can't find executables that are in PATH. This is a known issue where GUI applications on Windows don't properly inherit environment variables from their parent process.
.zshrc, .bash_profile, etc.) to get the PATH that would be available in your terminal, then applies it to the current process. This ensures GUI applications can find commands installed via Homebrew, package managers, or manually added to your shell PATH.