diff --git a/config/src/lib.rs b/config/src/lib.rs index ca7364819..b50daeb90 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -1158,9 +1158,6 @@ pub struct Config { #[serde(default = "default_true")] pub use_dead_keys: bool, - #[serde(default)] - pub use_local_build_for_proxy: bool, - #[serde(default)] pub launch_menu: Vec, diff --git a/wezterm-client/src/client.rs b/wezterm-client/src/client.rs index f25fa4a9d..98406760f 100644 --- a/wezterm-client/src/client.rs +++ b/wezterm-client/src/client.rs @@ -411,17 +411,30 @@ impl Reconnectable { } /// If debugging on wez's machine, use a path specific to that machine. - fn wezterm_bin_path(path: &Option) -> &str { + fn wezterm_bin_path(path: &Option) -> String { match path.as_ref() { - Some(p) => p, + Some(p) => p.clone(), None => { - if !configuration().use_local_build_for_proxy { - "wezterm" - } else if cfg!(debug_assertions) { - "/home/wez/wez-personal/wezterm/target/debug/wezterm" - } else { - "/home/wez/wez-personal/wezterm/target/release/wezterm" + if let Ok(exe) = std::env::current_exe() { + if let Some(exe) = exe + .with_file_name(if cfg!(windows) { + "wezterm.exe" + } else { + "wezterm" + }) + .to_str() + { + return exe.to_string(); + } } + + // Catch-all: ask kernel to resolve via PATH + if cfg!(windows) { + "wezterm.exe" + } else { + "wezterm" + } + .to_string() } } }