diff options
| author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-02-18 22:37:38 +0530 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:47:50 +0530 |
| commit | ef1c902be6c9d004f2f4124f7aa5b7d53fe22f17 (patch) | |
| tree | 08337574e02d7a4d953eadae2beb3f1b3b37ceae /src/server | |
| parent | remove command_is_executing from pty_thread (diff) | |
| download | sl0ppij-ef1c902be6c9d004f2f4124f7aa5b7d53fe22f17.tar.gz sl0ppij-ef1c902be6c9d004f2f4124f7aa5b7d53fe22f17.tar.xz sl0ppij-ef1c902be6c9d004f2f4124f7aa5b7d53fe22f17.zip | |
Introduce DoneCLosingPane message to ensure atomicity in state change
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/mod.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/server/mod.rs b/src/server/mod.rs index e62aa7fc..e71e91da 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,5 +1,4 @@ use crate::cli::CliArgs; -use crate::command_is_executing::CommandIsExecuting; use crate::common::{ ChannelWithContext, ClientInstruction, IpcSenderWithContext, SenderType, SenderWithContext, ServerInstruction, @@ -88,8 +87,20 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand .unwrap(); } } - PtyInstruction::ClosePane(id) => pty_bus.close_pane(id), - PtyInstruction::CloseTab(ids) => pty_bus.close_tab(ids), + PtyInstruction::ClosePane(id) => { + pty_bus.close_pane(id); + pty_bus + .send_server_instructions + .send(ServerInstruction::DoneClosingPane) + .unwrap(); + } + PtyInstruction::CloseTab(ids) => { + pty_bus.close_tab(ids); + pty_bus + .send_server_instructions + .send(ServerInstruction::DoneClosingPane) + .unwrap(); + } PtyInstruction::Exit => { break; } @@ -149,6 +160,11 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand .send(ClientInstruction::ToScreen(instr)) .unwrap(); } + ServerInstruction::DoneClosingPane => { + send_client_instructions[0] + .send(ClientInstruction::DoneClosingPane) + .unwrap(); + } ServerInstruction::ClosePluginPane(pid) => { send_client_instructions[0] .send(ClientInstruction::ClosePluginPane(pid)) |
