fix(plugins): make hide_self api idempotent (#2568)

* fix(plugins): make hide_self api idempotent

* style(fmt): rustfmt
This commit is contained in:
Aram Drevekenin 2023-06-20 16:38:01 +02:00 committed by GitHub
parent 4fc30ee7ad
commit 019452bdbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -2779,7 +2779,7 @@ pub(crate) fn screen_thread_main(
ScreenInstruction::SuppressPane(pane_id, client_id) => { ScreenInstruction::SuppressPane(pane_id, client_id) => {
let all_tabs = screen.get_tabs_mut(); let all_tabs = screen.get_tabs_mut();
for tab in all_tabs.values_mut() { for tab in all_tabs.values_mut() {
if tab.has_pane_with_pid(&pane_id) { if tab.has_non_suppressed_pane_with_pid(&pane_id) {
tab.suppress_pane(pane_id, client_id); tab.suppress_pane(pane_id, client_id);
drop(screen.render()); drop(screen.render());
break; break;

View file

@ -1308,6 +1308,9 @@ impl Tab {
|| self.floating_panes.panes_contain(pid) || self.floating_panes.panes_contain(pid)
|| self.suppressed_panes.values().any(|s_p| s_p.pid() == *pid) || self.suppressed_panes.values().any(|s_p| s_p.pid() == *pid)
} }
pub fn has_non_suppressed_pane_with_pid(&self, pid: &PaneId) -> bool {
self.tiled_panes.panes_contain(pid) || self.floating_panes.panes_contain(pid)
}
pub fn handle_pty_bytes(&mut self, pid: u32, bytes: VteBytes) -> Result<()> { pub fn handle_pty_bytes(&mut self, pid: u32, bytes: VteBytes) -> Result<()> {
if self.is_pending { if self.is_pending {
self.pending_instructions self.pending_instructions