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.

linux: Forward env vars starting with ZED_ to flatpak-spawn (#48118)

refi64f7a4fb1809ab
diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs
index 32d727962e0..1a7129fa0a4 100644
--- a/crates/cli/src/main.rs
+++ b/crates/cli/src/main.rs
@@ -952,6 +952,13 @@ mod flatpak {
pub fn try_restart_to_host() {
if let Some(flatpak_dir) = get_flatpak_dir() {
let mut args = vec!["/usr/bin/flatpak-spawn".into(), "--host".into()];
+
+ for (name, value) in env::vars() {
+ if name.starts_with("ZED_") {
+ args.push(format!("--env={}={}", name, value).into());
+ }
+ }
+
args.append(&mut get_xdg_env_args());
args.push("--env=ZED_UPDATE_EXPLANATION=Please use flatpak to update zed".into());
args.push(