diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-28 01:05:33 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-28 01:05:33 +0300 |
| commit | b6308ef3bec7ebd46ac830b3d36910171e94edf2 (patch) | |
| tree | 634866d39a3c98f0973d0f08c3da5018d051e337 /src/app/api.rs | |
| parent | 5a61ae2f9d89320c2e91d58fc3646b5a6a88f44a (diff) | |
feat: notify active panes when terminal is unfocused
Diffstat (limited to 'src/app/api.rs')
| -rw-r--r-- | src/app/api.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/app/api.rs b/src/app/api.rs index d7893d6d..5cfa3409 100644 --- a/src/app/api.rs +++ b/src/app/api.rs @@ -70,10 +70,12 @@ impl App { self.restore_overlay_after_exit(overlay); } - if matches!( - self.state.toast_config.delivery, - crate::config::ToastDelivery::Terminal - ) { + if self.local_terminal_notifications + && matches!( + self.state.toast_config.delivery, + crate::config::ToastDelivery::Terminal + ) + { if let Some(version) = update_ready_version { let _ = crate::terminal_notify::show_notification( &format!("v{version} available"), @@ -84,8 +86,13 @@ impl App { let is_active_tab = self .state .pane_is_in_active_tab(update.ws_idx, update.pane_id); + let suppress_active_tab_notifications = + crate::app::actions::active_tab_suppresses_notifications( + is_active_tab, + self.state.outer_terminal_focus, + ); let Some(kind) = crate::app::actions::notification_toast_for_state_change( - is_active_tab, + suppress_active_tab_notifications, update.previous_state, update.state, ) else { |
