summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-06-20 16:38:01 +0200
committerGitHub <noreply@github.com>2023-06-20 16:38:01 +0200
commit019452bdbf73748cc724f9681da2584cd4c1fdfd (patch)
tree04160bd443a439d8a23dbabe3862b23b8134a94d
parent4fc30ee7ad9ea106fb4c2648498141c7285ed240 (diff)
fix(plugins): make hide_self api idempotent (#2568)
* fix(plugins): make hide_self api idempotent * style(fmt): rustfmt
-rw-r--r--zellij-server/src/screen.rs2
-rw-r--r--zellij-server/src/tab/mod.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index 2bb93841e..6c41c1e7a 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -2779,7 +2779,7 @@ pub(crate) fn screen_thread_main(
ScreenInstruction::SuppressPane(pane_id, client_id) => {
let all_tabs = screen.get_tabs_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);
drop(screen.render());
break;
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs
index f1326c31c..d3a26b40d 100644
--- a/zellij-server/src/tab/mod.rs
+++ b/zellij-server/src/tab/mod.rs
@@ -1308,6 +1308,9 @@ impl Tab {
|| self.floating_panes.panes_contain(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<()> {
if self.is_pending {
self.pending_instructions