From 18adbcc1b1abc0b8999d9b7190b148685be19d77 Mon Sep 17 00:00:00 2001 From: Dante Pippi <6619666+dantepippi@users.noreply.github.com> Date: Thu, 17 Jun 2021 21:21:39 -0300 Subject: [PATCH 1/2] Detach session on a forced close (handlign SIGTERM and other signals) --- zellij-client/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs index 83121b678d..3e7ed7ab10 100644 --- a/zellij-client/src/lib.rs +++ b/zellij-client/src/lib.rs @@ -213,7 +213,7 @@ pub fn start_client( let send_client_instructions = send_client_instructions.clone(); move || { send_client_instructions - .send(ClientInstruction::Exit(ExitReason::Normal)) + .send(ClientInstruction::Exit(ExitReason::ForceDetached)) .unwrap() } }), From e7fc0e3ff92169b37797beff9744b8d14dadbe92 Mon Sep 17 00:00:00 2001 From: Dante Pippi <6619666+dantepippi@users.noreply.github.com> Date: Fri, 18 Jun 2021 12:26:29 -0300 Subject: [PATCH 2/2] Sending the action Action::Detach to the server --- zellij-client/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs index 3e7ed7ab10..e29bd16573 100644 --- a/zellij-client/src/lib.rs +++ b/zellij-client/src/lib.rs @@ -210,11 +210,9 @@ pub fn start_client( } }), Box::new({ - let send_client_instructions = send_client_instructions.clone(); + let os_api = os_input.clone(); move || { - send_client_instructions - .send(ClientInstruction::Exit(ExitReason::ForceDetached)) - .unwrap() + os_api.send_to_server(ClientToServerMsg::Action(Action::Detach)); } }), );