summaryrefslogtreecommitdiff
path: root/src/app/mod.rs
diff options
context:
space:
mode:
authorKataoka Katsuki <49934462+kataokatsuki@users.noreply.github.com>2026-08-04 23:46:43 +0900
committerGitHub <noreply@github.com>2026-08-04 17:46:43 +0300
commit1997b88b3fa45f838d44e69dcebde8acf33899fc (patch)
treeff406e43cb3eec45f57e38ccf77a36127df35b53 /src/app/mod.rs
parentcc9fa47540d8525f24fe46a10f759ca40090a6e0 (diff)
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 <kataokatsuki@users.noreply.github.com>
Diffstat (limited to 'src/app/mod.rs')
-rw-r--r--src/app/mod.rs5
1 files changed, 5 insertions, 0 deletions
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);
}