aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-03-19 00:05:24 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-04 20:47:51 +0530
commit2ab18244f718628fa1fc0a41a5c11692944d328c (patch)
treec0b5671f28c09fcab0e5e0bf3bb2c4533a9963c2 /src/common
parentDivide OsApi into ClientOsApi and ServerOsApi and move calls to os thread (diff)
downloadsl0ppij-2ab18244f718628fa1fc0a41a5c11692944d328c.tar.gz
sl0ppij-2ab18244f718628fa1fc0a41a5c11692944d328c.tar.xz
sl0ppij-2ab18244f718628fa1fc0a41a5c11692944d328c.zip
fix tests
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mod.rs10
-rw-r--r--src/common/os_input_output.rs8
2 files changed, 11 insertions, 7 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs
index 0b55d3b9..e8883d4f 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -31,7 +31,7 @@ use crate::server::start_server;
use command_is_executing::CommandIsExecuting;
use errors::{AppContext, ContextType, ErrorContext, PluginContext, ScreenContext};
use input::handler::input_loop;
-use os_input_output::{ClientOsApi, ServerOsApiInstruction};
+use os_input_output::{ClientOsApi, ServerOsApi, ServerOsApiInstruction};
use pty_bus::PtyInstruction;
use screen::{Screen, ScreenInstruction};
use serde::{Deserialize, Serialize};
@@ -200,8 +200,12 @@ impl From<ClientInstruction> for AppInstruction {
/// Start Zellij with the specified [`OsApi`] and command-line arguments.
// FIXME this should definitely be modularized and split into different functions.
-pub fn start(mut os_input: Box<dyn ClientOsApi>, opts: CliArgs) {
- let (ipc_thread, server_name) = start_server(opts.clone());
+pub fn start(
+ mut os_input: Box<dyn ClientOsApi>,
+ opts: CliArgs,
+ server_os_input: Box<dyn ServerOsApi>,
+) {
+ let (ipc_thread, server_name) = start_server(server_os_input.clone(), opts.clone());
let take_snapshot = "\u{1b}[?1049h";
os_input.unset_raw_mode(0);
diff --git a/src/common/os_input_output.rs b/src/common/os_input_output.rs
index 5c0115bc..d0c13ccd 100644
--- a/src/common/os_input_output.rs
+++ b/src/common/os_input_output.rs
@@ -160,8 +160,8 @@ pub struct ServerOsInputOutput {
orig_termios: Arc<Mutex<termios::Termios>>,
}
-/// The `OsApi` trait represents an abstract interface to the features of an operating system that
-/// Zellij requires.
+/// The `ServerOsApi` trait represents an abstract interface to the features of an operating system that
+/// Zellij server requires.
pub trait ServerOsApi: Send + Sync {
/// Sets the size of the terminal associated to file descriptor `fd`.
fn set_terminal_size_using_fd(&mut self, fd: RawFd, cols: u16, rows: u16);
@@ -234,8 +234,8 @@ pub struct ClientOsInputOutput {
orig_termios: Arc<Mutex<termios::Termios>>,
}
-/// The `OsApi` trait represents an abstract interface to the features of an operating system that
-/// Zellij requires.
+/// The `ClientOsApi` trait represents an abstract interface to the features of an operating system that
+/// Zellij client requires.
pub trait ClientOsApi: Send + Sync {
/// Returns the size of the terminal associated to file descriptor `fd`.
fn get_terminal_size_using_fd(&self, fd: RawFd) -> PositionAndSize;