diff options
Diffstat (limited to 'zellij-utils/src/ipc.rs')
-rw-r--r-- | zellij-utils/src/ipc.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs index a52689798..c0a7e2699 100644 --- a/zellij-utils/src/ipc.rs +++ b/zellij-utils/src/ipc.rs @@ -1,10 +1,12 @@ //! IPC stuff for starting to split things into a client and server model. - use crate::{ cli::CliArgs, data::{ClientId, InputMode, Style}, errors::{get_current_ctx, ErrorContext}, - input::{actions::Action, layout::LayoutFromYaml, options::Options, plugins::PluginsConfig}, + input::{ + actions::Action, keybinds::Keybinds, layout::LayoutFromYaml, options::Options, + plugins::PluginsConfig, + }, pane_size::{Size, SizeInPixels}, }; use interprocess::local_socket::LocalSocketStream; @@ -37,10 +39,11 @@ pub enum ClientType { Writer, } -#[derive(Default, Serialize, Deserialize, Debug, Clone, Copy)] +#[derive(Default, Serialize, Deserialize, Debug, Clone)] pub struct ClientAttributes { pub size: Size, pub style: Style, + pub keybinds: Keybinds, } #[derive(Default, Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] @@ -155,7 +158,7 @@ impl<T: Serialize> IpcSenderWithContext<T> { /// Sends an event, along with the current [`ErrorContext`], on this [`IpcSenderWithContext`]'s socket. pub fn send(&mut self, msg: T) { let err_ctx = get_current_ctx(); - bincode::serialize_into(&mut self.sender, &(msg, err_ctx)).unwrap(); + rmp_serde::encode::write(&mut self.sender, &(msg, err_ctx)).unwrap(); // TODO: unwrapping here can cause issues when the server disconnects which we don't mind // do we need to handle errors here in other cases? let _ = self.sender.flush(); @@ -193,7 +196,7 @@ where /// Receives an event, along with the current [`ErrorContext`], on this [`IpcReceiverWithContext`]'s socket. pub fn recv(&mut self) -> Option<(T, ErrorContext)> { - match bincode::deserialize_from(&mut self.receiver) { + match rmp_serde::decode::from_read(&mut self.receiver) { Ok(msg) => Some(msg), Err(e) => { warn!("Error in IpcReceiver.recv(): {:?}", e); |