summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-04-13 10:05:38 +0200
committerGitHub <noreply@github.com>2022-04-13 10:05:38 +0200
commitb185f2827f3871d6bdfc77f529d792beb0a28700 (patch)
tree3f165056cbc21332f2a8426afb4f050a7efa557b
parent8e53fcbe1bf92a4cb55ff93d04321527bc1de2b7 (diff)
fix(multiuser): properly clear UI when a user detaches (#1317)
-rw-r--r--src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap2
-rw-r--r--zellij-server/src/lib.rs16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap
index f7d0dce7c..af538e253 100644
--- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap
+++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap
@@ -5,7 +5,7 @@ expression: last_snapshot
---
Zellij (e2e-test)  Tab #1 
┌ Pane #1 ─────────────────────────────────────────────────┐┌ Pane #2 ─────────────────────────────────────────────────┐
-│$ ││$ I am some text█ │
+│$ █ ││$ I am some text │
│ ││ │
│ ││ │
│ ││ │
diff --git a/zellij-server/src/lib.rs b/zellij-server/src/lib.rs
index 13d2f5c56..88f850139 100644
--- a/zellij-server/src/lib.rs
+++ b/zellij-server/src/lib.rs
@@ -477,6 +477,22 @@ pub fn start_server(mut os_input: Box<dyn ServerOsApi>, socket_path: PathBuf) {
.send_to_screen(ScreenInstruction::TerminalResize(min_size))
.unwrap();
}
+ session_data
+ .write()
+ .unwrap()
+ .as_ref()
+ .unwrap()
+ .senders
+ .send_to_screen(ScreenInstruction::RemoveClient(client_id))
+ .unwrap();
+ session_data
+ .write()
+ .unwrap()
+ .as_ref()
+ .unwrap()
+ .senders
+ .send_to_plugin(PluginInstruction::RemoveClient(client_id))
+ .unwrap();
}
ServerInstruction::Render(serialized_output) => {
let client_ids = session_state.read().unwrap().client_ids();