remote: Recognize WSL interop to open browser for codex web login (#44136)

Closes #41521

Release Notes:

- Fixed codex web login not working on wsl remotes if no browser is
installed

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Lukas Wirth
2025-12-04 14:42:26 +00:00
committed by GitHub
co-authored by Ben Brandt
parent c978db8626
commit a33e881906
9 changed files with 79 additions and 17 deletions
+10 -2
View File
@@ -199,6 +199,7 @@ fn start_server(
listeners: ServerListeners,
log_rx: Receiver<Vec<u8>>,
cx: &mut App,
is_wsl_interop: bool,
) -> AnyProtoClient {
// This is the server idle timeout. If no connection comes in this timeout, the server will shut down.
const IDLE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10 * 60);
@@ -318,7 +319,7 @@ fn start_server(
})
.detach();
RemoteClient::proto_client_from_channels(incoming_rx, outgoing_tx, cx, "server")
RemoteClient::proto_client_from_channels(incoming_rx, outgoing_tx, cx, "server", is_wsl_interop)
}
fn init_paths() -> anyhow::Result<()> {
@@ -407,8 +408,15 @@ pub fn execute_run(
HeadlessProject::init(cx);
let is_wsl_interop = if cfg!(target_os = "linux") {
// See: https://learn.microsoft.com/en-us/windows/wsl/filesystems#disable-interoperability
matches!(std::fs::read_to_string("/proc/sys/fs/binfmt_misc/WSLInterop"), Ok(s) if s.contains("enabled"))
} else {
false
};
log::info!("gpui app started, initializing server");
let session = start_server(listeners, log_rx, cx);
let session = start_server(listeners, log_rx, cx, is_wsl_interop);
GitHostingProviderRegistry::set_global(git_hosting_provider_registry, cx);
git_hosting_providers::init(cx);