diff options
| author | denis <denismaximov98@gmail.com> | 2021-03-01 15:19:40 +0200 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:47:50 +0530 |
| commit | 627e6b3672f6a02e2dac1e6a597088e97a9f631f (patch) | |
| tree | 4269d50fb4fbc2985d51729db5e2045dada38c27 /src/server | |
| parent | Introduce DoneCLosingPane message to ensure atomicity in state change (diff) | |
| download | sl0ppij-627e6b3672f6a02e2dac1e6a597088e97a9f631f.tar.gz sl0ppij-627e6b3672f6a02e2dac1e6a597088e97a9f631f.tar.xz sl0ppij-627e6b3672f6a02e2dac1e6a597088e97a9f631f.zip | |
wip: working on osapi message variants
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/mod.rs b/src/server/mod.rs index e71e91da..fef66366 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -4,7 +4,7 @@ use crate::common::{ ServerInstruction, }; use crate::errors::{ContextType, ErrorContext, PtyContext}; -use crate::os_input_output::OsApi; +use crate::os_input_output::{OsApi, OsApiInstruction}; use crate::panes::PaneId; use crate::pty_bus::{PtyBus, PtyInstruction}; use crate::screen::ScreenInstruction; @@ -24,6 +24,12 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand let server_buffer = SharedRingBuffer::create(ZELLIJ_IPC_PIPE, 8192).unwrap(); + let (send_os_instructions, receive_os_instructions): ChannelWithContext<OsApiInstruction> = channel(); + let mut send_os_instructions = SenderWithContext::new( + ErrorContext::new(), + SenderType::Sender(send_os_instructions), + ); + // Don't use default layouts in tests, but do everywhere else #[cfg(not(test))] let default_layout = Some(PathBuf::from("default")); @@ -160,6 +166,9 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand .send(ClientInstruction::ToScreen(instr)) .unwrap(); } + ServerInstruction::OsApi(instr) => { + send_os_instructions.send(instr).unwrap(); + } ServerInstruction::DoneClosingPane => { send_client_instructions[0] .send(ClientInstruction::DoneClosingPane) |
