From 37c340324175bf5d80440d59330a2a05459ebbc9 Mon Sep 17 00:00:00 2001 From: Srevin Saju Date: Sat, 27 Nov 2021 21:03:07 +0300 Subject: [PATCH] fix: do not propagate $APPIMAGE and $APPDIR env vars to child processes --- config/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/src/lib.rs b/config/src/lib.rs index 2fe728ef2..14292a4b9 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -1839,6 +1839,17 @@ impl Config { // across the win32/wsl boundary let mut wsl_env = std::env::var("WSLENV").ok(); + // Since we are running inside the appimage, we have "$APPIMAGE" + // and "$APPDIR" set inside the wezterm appimage. This gets + // propagated to the child processes. Since some apps (including + // wezterm) use these variables to detect if they are running in + // an appimage, the child processes get misconfigured + // We should just unset them too. + // https://docs.appimage.org/packaging-guide/environment-variables.html#id2 + cmd.env_remove("APPIMAGE"); + cmd.env_remove("APPDIR"); + cmd.env_remove("OWD"); + for (k, v) in &self.set_environment_variables { if k == "WSLENV" { wsl_env.replace(v.clone());