From 9407d86ce615fd13589f264e4c595a328effa0f1 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Wed, 11 Sep 2024 13:33:42 -0400 Subject: [PATCH] project: Use login shell to get environment per project (#17717) This is a follow-up to #17075 to spawn a login shell when getting the environment for projects. The reason why we didn't do it before is that we only used the environment for certain language servers and not a lot of other things, like tasks. But with #17075 we now use the project more often and use it as the _base_ environment for tasks/terminals. Before the change, terminals and tasks would inherit the Zed process' environment, including PATH and so on. After the change, we would set the environment, overwriting the PATH instead of merging. But the non-login shell environment is a subset of the login-shell environment. Release Notes: - Fixed environment variables used per project in terminals/tasks overwriting the base environment and not making use of a login-shell environment. --- crates/project/src/environment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/project/src/environment.rs b/crates/project/src/environment.rs index b74b577b3992d3fdd7e660b2b3b8807fa0443e43..9742b8b6d58e323468d67bedcfeab63210f263c0 100644 --- a/crates/project/src/environment.rs +++ b/crates/project/src/environment.rs @@ -219,7 +219,7 @@ async fn load_shell_environment( ); let output = smol::process::Command::new(&shell) - .args(["-i", "-c", &command]) + .args(["-l", "-i", "-c", &command]) .envs(direnv_environment) .output() .await