mux: fix unseen output status for remote panes

refs: #2625
This commit is contained in:
Wez Furlong committed 2023-04-03 21:12:18 -07:00
1 parent ad953c535e
commit e28b3cec4e
2 files changed
+17

No files matched your search

+3
View File
@@ -84,6 +84,9 @@ As features stabilize some brief notes about them will accumulate here.
* ssh: `%r` `%h` and `%p` tokens were implicitly supported by libssh but stopped
working in `ProxyCommand` when we took over running the proxy command. #3437
* mux: Improved latency for large window sizes. #1872
* mux: [pane:has_unseen_output()](config/lua/pane/has_unseen_output.md) and
[PaneInformation.has_unseen_output](config/lua/PaneInformation.md) now work
with multiplexer panes. #2625
### 20230326-111934-3666303c
+14
View File
@@ -47,6 +47,7 @@ pub struct ClientPane {
ignore_next_kill: Mutex<bool>,
user_vars: Mutex<HashMap<String, String>>,
config: Mutex<Option<Arc<dyn TerminalConfiguration>>>,
unseen_output: Mutex<bool>,
}
impl ClientPane {
@@ -125,6 +126,7 @@ impl ClientPane {
clipboard: Mutex::new(None),
mouse_grabbed: Mutex::new(false),
ignore_next_kill: Mutex::new(false),
unseen_output: Mutex::new(false),
user_vars: Mutex::new(HashMap::new()),
config: Mutex::new(None),
}
@@ -181,6 +183,13 @@ impl ClientPane {
Alert::SetUserVar { name, value } => {
self.user_vars.lock().insert(name.clone(), value.clone());
}
Alert::OutputSinceFocusLost => {
*self.unseen_output.lock() = true;
mux.notify(MuxNotification::Alert {
pane_id: self.local_pane_id,
alert: Alert::OutputSinceFocusLost,
});
}
_ => {}
}
mux.notify(MuxNotification::Alert {
@@ -535,6 +544,7 @@ impl Pane for ClientPane {
fn focus_changed(&self, focused: bool) {
if focused {
self.advise_focus();
*self.unseen_output.lock() = false;
}
}
@@ -571,6 +581,10 @@ impl Pane for ClientPane {
}
}
fn has_unseen_output(&self) -> bool {
*self.unseen_output.lock()
}
fn can_close_without_prompting(&self, reason: CloseReason) -> bool {
match reason {
CloseReason::Window => true,