From 74bf1a170d44e62140e2d6537c716d02f7fd71c5 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 7 Nov 2025 16:46:37 +0100 Subject: [PATCH] recent_projects: Do not try to watch `/etc/ssh/ssh_config` on windows (#42200) Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/agent/src/agent.rs | 2 +- crates/agent_ui/src/language_model_selector.rs | 2 +- crates/paths/src/paths.rs | 8 ++++++-- crates/recent_projects/src/remote_servers.rs | 8 +++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/crates/agent/src/agent.rs b/crates/agent/src/agent.rs index a9b3c65fa89ae9d9b89180fd776b0868754ab78e..8f2c90667bf21943692cd87eed1153234dc6f89d 100644 --- a/crates/agent/src/agent.rs +++ b/crates/agent/src/agent.rs @@ -218,7 +218,7 @@ impl LanguageModels { } _ => { log::error!( - "Failed to authenticate provider: {}: {err}", + "Failed to authenticate provider: {}: {err:#}", provider_name.0 ); } diff --git a/crates/agent_ui/src/language_model_selector.rs b/crates/agent_ui/src/language_model_selector.rs index eb5a734b4ca57c2b79ac0dd004e42fc59c195fed..c8838fd9bc8b33ccb87f3198126c5c470328c810 100644 --- a/crates/agent_ui/src/language_model_selector.rs +++ b/crates/agent_ui/src/language_model_selector.rs @@ -177,7 +177,7 @@ impl LanguageModelPickerDelegate { } _ => { log::error!( - "Failed to authenticate provider: {}: {err}", + "Failed to authenticate provider: {}: {err:#}", provider_name.0 ); } diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs index 1197e9c546075dbe9342efe49ace1766fd281925..a4c8f2424967cc3e0c4c2a76650811a7639ef5cb 100644 --- a/crates/paths/src/paths.rs +++ b/crates/paths/src/paths.rs @@ -460,8 +460,12 @@ pub fn user_ssh_config_file() -> PathBuf { home_dir().join(".ssh/config") } -pub fn global_ssh_config_file() -> &'static Path { - Path::new("/etc/ssh/ssh_config") +pub fn global_ssh_config_file() -> Option<&'static Path> { + if cfg!(windows) { + None + } else { + Some(Path::new("/etc/ssh/ssh_config")) + } } /// Returns candidate paths for the vscode user settings file diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rs index 7c9f9fe96515a65fab95afff5f0d336102ef9223..76b0b230dc16b5d5e594379bb94b30ca66b9b317 100644 --- a/crates/recent_projects/src/remote_servers.rs +++ b/crates/recent_projects/src/remote_servers.rs @@ -2199,11 +2199,9 @@ impl RemoteServerProjects { fn spawn_ssh_config_watch(fs: Arc, cx: &Context) -> Task<()> { let mut user_ssh_config_watcher = watch_config_file(cx.background_executor(), fs.clone(), user_ssh_config_file()); - let mut global_ssh_config_watcher = watch_config_file( - cx.background_executor(), - fs, - global_ssh_config_file().to_owned(), - ); + let mut global_ssh_config_watcher = global_ssh_config_file() + .map(|it| watch_config_file(cx.background_executor(), fs, it.to_owned())) + .unwrap_or_else(|| futures::channel::mpsc::unbounded().1); cx.spawn(async move |remote_server_projects, cx| { let mut global_hosts = BTreeSet::default();