summaryrefslogtreecommitdiffstats
path: root/zellij-client
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-05-21 01:32:58 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-22 22:19:50 +0530
commitb8acf190710e97092def6ef3adfe44e992ca140c (patch)
treec8adb9732b6230481e899955b9cdd694770bdca2 /zellij-client
parent61aa1045764db63734532486cab0500e5828daad (diff)
Use Action enum for Quit and detach instead of separate messages under ClientToServerMsg
Diffstat (limited to 'zellij-client')
-rw-r--r--zellij-client/src/input_handler.rs4
-rw-r--r--zellij-client/src/lib.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/zellij-client/src/input_handler.rs b/zellij-client/src/input_handler.rs
index 4e2cff94c..9fa001cda 100644
--- a/zellij-client/src/input_handler.rs
+++ b/zellij-client/src/input_handler.rs
@@ -132,7 +132,9 @@ impl InputHandler {
let mut should_break = false;
match action {
- Action::Quit => {
+ Action::Quit | Action::Detach => {
+ self.os_input
+ .send_to_server(ClientToServerMsg::Action(action));
self.exit();
should_break = true;
}
diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs
index 8f192c388..0eff09af0 100644
--- a/zellij-client/src/lib.rs
+++ b/zellij-client/src/lib.rs
@@ -19,8 +19,7 @@ use zellij_utils::{
channels::{SenderType, SenderWithContext, SyncChannelWithContext},
consts::{SESSION_NAME, ZELLIJ_IPC_PIPE},
errors::{ClientContext, ContextType, ErrorInstruction},
- input::config::Config,
- input::options::Options,
+ input::{actions::Action, config::Config, options::Options},
ipc::{ClientAttributes, ClientToServerMsg, ServerToClientMsg},
};
@@ -226,7 +225,7 @@ pub fn start_client(mut os_input: Box<dyn ClientOsApi>, opts: CliArgs, config: C
match client_instruction {
ClientInstruction::Exit => break,
ClientInstruction::Error(backtrace) => {
- let _ = os_input.send_to_server(ClientToServerMsg::ClientExit);
+ let _ = os_input.send_to_server(ClientToServerMsg::Action(Action::Quit));
handle_error(backtrace);
}
ClientInstruction::ServerError(backtrace) => {
@@ -248,7 +247,6 @@ pub fn start_client(mut os_input: Box<dyn ClientOsApi>, opts: CliArgs, config: C
}
}
- let _ = os_input.send_to_server(ClientToServerMsg::ClientExit);
router_thread.join().unwrap();
// cleanup();