Skip to content

Commit 74bf1a1

Browse files
authored
recent_projects: Do not try to watch /etc/ssh/ssh_config on windows (#42200)
Release Notes: - N/A *or* Added/Fixed/Improved ...
1 parent e72c3bf commit 74bf1a1

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

crates/agent/src/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl LanguageModels {
218218
}
219219
_ => {
220220
log::error!(
221-
"Failed to authenticate provider: {}: {err}",
221+
"Failed to authenticate provider: {}: {err:#}",
222222
provider_name.0
223223
);
224224
}

crates/agent_ui/src/language_model_selector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl LanguageModelPickerDelegate {
177177
}
178178
_ => {
179179
log::error!(
180-
"Failed to authenticate provider: {}: {err}",
180+
"Failed to authenticate provider: {}: {err:#}",
181181
provider_name.0
182182
);
183183
}

crates/paths/src/paths.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,12 @@ pub fn user_ssh_config_file() -> PathBuf {
460460
home_dir().join(".ssh/config")
461461
}
462462

463-
pub fn global_ssh_config_file() -> &'static Path {
464-
Path::new("/etc/ssh/ssh_config")
463+
pub fn global_ssh_config_file() -> Option<&'static Path> {
464+
if cfg!(windows) {
465+
None
466+
} else {
467+
Some(Path::new("/etc/ssh/ssh_config"))
468+
}
465469
}
466470

467471
/// Returns candidate paths for the vscode user settings file

crates/recent_projects/src/remote_servers.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,11 +2199,9 @@ impl RemoteServerProjects {
21992199
fn spawn_ssh_config_watch(fs: Arc<dyn Fs>, cx: &Context<RemoteServerProjects>) -> Task<()> {
22002200
let mut user_ssh_config_watcher =
22012201
watch_config_file(cx.background_executor(), fs.clone(), user_ssh_config_file());
2202-
let mut global_ssh_config_watcher = watch_config_file(
2203-
cx.background_executor(),
2204-
fs,
2205-
global_ssh_config_file().to_owned(),
2206-
);
2202+
let mut global_ssh_config_watcher = global_ssh_config_file()
2203+
.map(|it| watch_config_file(cx.background_executor(), fs, it.to_owned()))
2204+
.unwrap_or_else(|| futures::channel::mpsc::unbounded().1);
22072205

22082206
cx.spawn(async move |remote_server_projects, cx| {
22092207
let mut global_hosts = BTreeSet::default();

0 commit comments

Comments
 (0)