diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-08-11 02:24:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-11 03:24:02 +0300 |
| commit | 7ae4b056a0ca478e584fa282c45b528134cc80c9 (patch) | |
| tree | 5eb8da51353327f2bb1b7ef35f76cafe9b471dee /src/app/api.rs | |
| parent | 350f001320ec4a119f09c38157973126962a6121 (diff) | |
fix: wait for agent prompt readiness (#2537)
* fix: wait for agent prompt readiness
refs #2410
* fix: return pane updates after tab bar command
refs #2410
---------
Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/app/api.rs')
| -rw-r--r-- | src/app/api.rs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/app/api.rs b/src/app/api.rs index 18471f57..92d9596f 100644 --- a/src/app/api.rs +++ b/src/app/api.rs @@ -106,13 +106,20 @@ impl App { } pub(crate) fn handle_internal_event(&mut self, ev: AppEvent) { + let _ = self.handle_internal_event_with_pane_updates(ev); + } + + pub(crate) fn handle_internal_event_with_pane_updates( + &mut self, + ev: AppEvent, + ) -> Vec<crate::app::actions::PaneStateUpdate> { if let AppEvent::TerminalBell { count, .. } = ev { if let Err(err) = crate::terminal_effects::write_terminal_bells(&mut std::io::stdout(), count) { tracing::warn!(err = %err, "failed to emit terminal bell"); } - return; + return Vec::new(); } if let AppEvent::ClipboardWrite { content } = ev { @@ -121,7 +128,7 @@ impl App { #[cfg(test)] let _ = content; self.show_clipboard_feedback(); - return; + return Vec::new(); } if let AppEvent::PrefixInputSource { active } = ev { @@ -130,14 +137,14 @@ impl App { // App-internal drain consume the event before the forwarding drain, the flag keeps the // switch out of the headless server process. if !self.local_input_source_switch { - return; + return Vec::new(); } if active { self.prefix_input_source.switch_to_ascii(); } else { self.prefix_input_source.restore(); } - return; + return Vec::new(); } if let AppEvent::GitStatusRefreshed { @@ -146,7 +153,7 @@ impl App { } = ev { self.handle_git_status_refreshed(results, cache_updates); - return; + return Vec::new(); } if let AppEvent::TabBarCommandFinished { @@ -156,7 +163,7 @@ impl App { } = ev { let _ = self.handle_tab_bar_command_finished(generation, segment_index, result); - return; + return Vec::new(); } if let AppEvent::PluginCommandFinished { @@ -187,17 +194,17 @@ impl App { crate::api::schema::PluginCommandStatus::Failed }; } - return; + return Vec::new(); } if let AppEvent::WorktreeAddFinished(result) = ev { self.handle_worktree_add_finished(*result); - return; + return Vec::new(); } if let AppEvent::WorktreeRemoveFinished(result) = ev { self.handle_worktree_remove_finished(*result); - return; + return Vec::new(); } if let AppEvent::PaneDied { pane_id } = &ev { @@ -208,7 +215,7 @@ impl App { .is_some_and(|popup| popup.pane_id == *pane_id) { self.close_popup_pane(); - return; + return Vec::new(); } let previous_toast = self.state.toast.clone(); if let Some(update) = self.state.publish_pane_process_exit_if_agent(*pane_id) { @@ -223,7 +230,7 @@ impl App { self.overlay_panes.remove(pane_id); self.render_dirty.request_generic(); self.render_notify.notify_one(); - return; + return Vec::new(); } } @@ -368,6 +375,7 @@ impl App { self.sync_toast_deadline(previous_toast); self.shutdown_detached_terminal_runtimes(); + pane_updates } fn reset_agent_detection_for_agents(&self, agents: &[crate::detect::Agent]) { |
