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 accidentally dropping shell environment variable (#10105)

Thorsten Ball7dbcace8393f
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs
index ddff16fd5b4..4d5598621b8 100644
--- a/crates/project/src/project.rs
+++ b/crates/project/src/project.rs
@@ -10017,7 +10017,7 @@ async fn load_shell_environment(dir: &Path) -> Result<HashMap<String, String>> {
});
let command = format!(
- "cd '{}';{} echo {marker}; /usr/bin/env -0; exit 0;",
+ "cd '{}';{} printf '%s' {marker}; /usr/bin/env -0; exit 0;",
dir.display(),
additional_command.unwrap_or("")
);
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs
index dac37ba7f0a..c3a3367c082 100644
--- a/crates/zed/src/main.rs
+++ b/crates/zed/src/main.rs
@@ -906,7 +906,7 @@ async fn load_login_shell_environment() -> Result<()> {
// We still don't know why `$SHELL -l -i -c '/usr/bin/env -0'` would
// do that, but it does, and `exit 0` helps.
let shell_cmd = format!(
- "{}echo {marker}; /usr/bin/env -0; exit 0;",
+ "{}printf '%s' {marker}; /usr/bin/env -0; exit 0;",
shell_cmd_prefix.as_deref().unwrap_or("")
);