From 1d043b37fbff21c097f62d09b16451cef7bf29ad Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Fri, 16 May 2025 04:04:36 -0500 Subject: [PATCH] askpass: Workaround rust lang 69343 (#30774) Closes #ISSUE Work around https://github.com/rust-lang/rust/issues/69343 in askpass Release Notes: - linux: Fixed an issue with askpass where the Zed binary path would be incorrect after an auto-update is installed but not yet applied --- crates/askpass/src/askpass.rs | 4 +++- crates/gpui/src/platform/linux/platform.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/askpass/src/askpass.rs b/crates/askpass/src/askpass.rs index 5a07792e88..03b4be8bd1 100644 --- a/crates/askpass/src/askpass.rs +++ b/crates/askpass/src/askpass.rs @@ -163,8 +163,10 @@ impl AskPassSession { #[cfg(unix)] fn get_shell_safe_zed_path() -> anyhow::Result { let zed_path = std::env::current_exe() - .context("Failed to figure out current executable path for use in askpass")? + .context("Failed to determine current executable path for use in askpass")? .to_string_lossy() + // see https://github.com/rust-lang/rust/issues/69343 + .trim_end_matches(" (deleted)") .to_string(); // NOTE: this was previously enabled, however, it caused errors when it shouldn't have diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index 167e232f0b..8fb3c0bf96 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -426,8 +426,8 @@ impl Platform for P { fn app_path(&self) -> Result { // get the path of the executable of the current process - let exe_path = env::current_exe()?; - Ok(exe_path) + let app_path = env::current_exe()?; + return Ok(app_path); } fn set_menus(&self, menus: Vec, _keymap: &Keymap) {