diff options
| author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-22 15:45:47 +0530 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-22 22:19:50 +0530 |
| commit | fa0a7e05c384f0da1a6fe3dd240181a6ff528b58 (patch) | |
| tree | b188dbaefc080c0155475634c7427d8322fa5ef9 /src | |
| parent | add keybinds for session mode and detach (diff) | |
| download | sl0ppij-fa0a7e05c384f0da1a6fe3dd240181a6ff528b58.tar.gz sl0ppij-fa0a7e05c384f0da1a6fe3dd240181a6ff528b58.tar.xz sl0ppij-fa0a7e05c384f0da1a6fe3dd240181a6ff528b58.zip | |
Add ability to attach to sessions
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 15 | ||||
| -rw-r--r-- | src/tests/fakes.rs | 1 | ||||
| -rw-r--r-- | src/tests/mod.rs | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 82fc14d5..319ad307 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,20 @@ pub fn main() { process::exit(1); } }; - start_client(Box::new(os_input), opts, config); + if let Some(Command::Sessions(Sessions::Attach { + session_name, + force, + })) = opts.command.clone() + { + start_client( + Box::new(os_input), + opts, + config, + Some((session_name, force)), + ); + } else { + start_client(Box::new(os_input), opts, config, None); + } } } diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs index c81e226f..cb41821a 100644 --- a/src/tests/fakes.rs +++ b/src/tests/fakes.rs @@ -300,6 +300,7 @@ impl ServerOsApi for FakeInputOutput { } fn add_client_sender(&self) {} fn remove_client_sender(&self) {} + fn send_to_temp_client(&self, _msg: ServerToClientMsg) {} fn update_receiver(&mut self, _stream: LocalSocketStream) {} fn load_palette(&self) -> Palette { default_palette() diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 3e548db7..f8a48a39 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -21,6 +21,6 @@ pub fn start( start_server(server_os_input, PathBuf::from("")); }) .unwrap(); - start_client(client_os_input, opts, config); + start_client(client_os_input, opts, config, None); let _ = server_thread.join(); } |
