fix: do not propagate $APPIMAGE and $APPDIR env vars to child processes

This commit is contained in:
Srevin Saju authored and Wez Furlong committed 2021-12-02 21:21:29 -07:00
1 parent a61fa57d97
commit 37c3403241
1 file changed
+11
+11
View File
@@ -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());