Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix overly noisy direnv error notification (#41029)

Cole Miller63fe1eae59fa
diff --git a/crates/project/src/environment.rs b/crates/project/src/environment.rs
index 4dd1e94b9fc..c04f1350aa7 100644
--- a/crates/project/src/environment.rs
+++ b/crates/project/src/environment.rs
@@ -324,7 +324,9 @@ async fn load_direnv_environment(
env: &HashMap<String, String>,
dir: &Path,
) -> anyhow::Result<HashMap<String, Option<String>>> {
- let direnv_path = which::which("direnv").context("finding direnv binary")?;
+ let Some(direnv_path) = which::which("direnv").ok() else {
+ return Ok(HashMap::default());
+ };
let args = &["export", "json"];
let direnv_output = smol::process::Command::new(&direnv_path)