From 1997b88b3fa45f838d44e69dcebde8acf33899fc Mon Sep 17 00:00:00 2001 From: Kataoka Katsuki <49934462+kataokatsuki@users.noreply.github.com> Date: Tue, 4 Aug 2026 23:46:43 +0900 Subject: fix(input): keep pending url clicks across host focus loss (#2291) Opening a URL raises the browser, which takes focus away from the host terminal before the mouse release arrives. release_input_source(_headless) cleared pending_url_click_sources on that focus loss, so the release was forwarded to the pane and the agent opened the same URL again. Clear the set in clear_input_source instead, whose only production caller is remove_client. refs #2290 Co-authored-by: kataokatsuki --- src/app/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/app/mod.rs') diff --git a/src/app/mod.rs b/src/app/mod.rs index 82ac1a60..c27c249e 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1778,6 +1778,11 @@ impl App { } pub(crate) fn clear_input_source(&mut self, source_id: InputSourceId) { + // Call this only when the input source is gone for good. A pending URL + // click has to outlive a plain focus change, because opening the URL + // raises the browser and costs the host terminal its focus before the + // mouse release arrives. + self.pending_url_click_sources.remove(&source_id); self.release_input_source_headless(source_id); } -- cgit v1.2.3