Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent_ui: Do not show Codex wsl warning on wsl (#42079)
Lukas Wirthf6da987d4cd1
diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rsindex db43fe5f8a2..c61854132c6 100644--- a/crates/agent_ui/src/acp/thread_view.rs+++ b/crates/agent_ui/src/acp/thread_view.rs@@ -294,7 +294,6 @@ pub struct AcpThreadView {resume_thread_metadata: Option<DbThreadMetadata>,_cancel_task: Option<Task<()>>,_subscriptions: [Subscription; 5],- #[cfg(target_os = "windows")]show_codex_windows_warning: bool,}@@ -401,7 +400,6 @@ impl AcpThreadView {),];- #[cfg(target_os = "windows")]let show_codex_windows_warning = crate::ExternalAgent::parse_built_in(agent.as_ref())== Some(crate::ExternalAgent::Codex);@@ -447,7 +445,6 @@ impl AcpThreadView {focus_handle: cx.focus_handle(),new_server_version_available: None,resume_thread_metadata: resume_thread,- #[cfg(target_os = "windows")]show_codex_windows_warning,}}@@ -5252,7 +5249,6 @@ impl AcpThreadView {)}- #[cfg(target_os = "windows")]fn render_codex_windows_warning(&self, cx: &mut Context<Self>) -> Option<Callout> {if self.show_codex_windows_warning {Some(@@ -5268,8 +5264,9 @@ impl AcpThreadView {.icon_size(IconSize::Small).icon_color(Color::Muted).on_click(cx.listener({- move |_, _, window, cx| {- window.dispatch_action(+ move |_, _, _window, cx| {+ #[cfg(windows)]+ _window.dispatch_action(zed_actions::wsl_actions::OpenWsl::default().boxed_clone(),cx,);@@ -5772,13 +5769,15 @@ impl Render for AcpThreadView {}).children(self.render_thread_retry_status_callout(window, cx)).children({- #[cfg(target_os = "windows")]+ if self+ .project+ .read(cx)+ .remote_connection_options(cx)+ .is_some_and(|it| it.is_wsl()){self.render_codex_windows_warning(cx)- }- #[cfg(not(target_os = "windows"))]- {- Vec::<Empty>::new()+ } else {+ None}}).children(self.render_thread_error(cx))diff --git a/crates/remote/src/remote_client.rs b/crates/remote/src/remote_client.rsindex 54ec6644b9a..554e6ee1c49 100644--- a/crates/remote/src/remote_client.rs+++ b/crates/remote/src/remote_client.rs@@ -1077,6 +1077,10 @@ impl RemoteConnectionOptions {RemoteConnectionOptions::Wsl(opts) => opts.distro_name.clone(),}}++ pub fn is_wsl(&self) -> bool {+ matches!(self, RemoteConnectionOptions::Wsl(_))+ }}impl From<SshConnectionOptions> for RemoteConnectionOptions {