From 0f307e7ca2aa8e485e5c83457cc71ead1bbd63a2 Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Fri, 1 Dec 2023 05:14:09 +0530 Subject: [PATCH] preserve sudo env; required for WAYLAND_DISPLAY Signed-off-by: Sahil Yeole --- src/platform/linux.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 58e9a9e0f..db37d573a 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -591,10 +591,8 @@ where let xdg = &format!("XDG_RUNTIME_DIR=/run/user/{}", uid) as &str; let mut args = vec![xdg, "-u", &username, cmd.to_str().unwrap_or("")]; args.append(&mut arg.clone()); - // -E required for opensuse - if is_opensuse() { + // -E is required to preserve env args.insert(0, "-E"); - } let task = Command::new("sudo").envs(envs).args(args).spawn()?; Ok(Some(task))