aboutsummaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-11 22:09:33 +0200
committerGitHub <noreply@github.com>2021-05-11 22:09:33 +0200
commit38b8f64ae641ae8f2ad993c2866d42b1f6a3d995 (patch)
tree5d46cd3d0b5ceaaf7c79b1dfc6ccee15065923e6 /src/server
parentMerge pull request #488 from a-kenji/darwin-config-dir (diff)
parent!fixup Add Option for Simplified Layout (diff)
downloadsl0ppij-38b8f64ae641ae8f2ad993c2866d42b1f6a3d995.tar.gz
sl0ppij-38b8f64ae641ae8f2ad993c2866d42b1f6a3d995.tar.xz
sl0ppij-38b8f64ae641ae8f2ad993c2866d42b1f6a3d995.zip
Merge pull request #479 from a-kenji/simple-font-ui
Add Option for Simplified Layout
Diffstat (limited to 'src/server')
-rw-r--r--src/server/mod.rs25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/server/mod.rs b/src/server/mod.rs
index 3655ed19..d9875727 100644
--- a/src/server/mod.rs
+++ b/src/server/mod.rs
@@ -12,7 +12,7 @@ use crate::client::ClientInstruction;
use crate::common::thread_bus::{Bus, ThreadSenders};
use crate::common::{
errors::{ContextType, ServerContext},
- input::actions::Action,
+ input::{actions::Action, options::Options},
os_input_output::{set_permissions, ServerOsApi},
pty::{pty_thread_main, Pty, PtyInstruction},
screen::{screen_thread_main, ScreenInstruction},
@@ -30,7 +30,7 @@ use route::route_thread_main;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum ServerInstruction {
TerminalResize(PositionAndSize),
- NewClient(PositionAndSize, CliArgs),
+ NewClient(PositionAndSize, CliArgs, Options),
Action(Action),
Render(Option<String>),
UnblockInputThread,
@@ -115,9 +115,14 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>) -> thread::JoinHandle<()> {
let (instruction, mut err_ctx) = server_receiver.recv().unwrap();
err_ctx.add_call(ContextType::IPCServer(ServerContext::from(&instruction)));
match instruction {
- ServerInstruction::NewClient(full_screen_ws, opts) => {
- let session_data =
- init_session(os_input.clone(), opts, to_server.clone(), full_screen_ws);
+ ServerInstruction::NewClient(full_screen_ws, opts, config_options) => {
+ let session_data = init_session(
+ os_input.clone(),
+ opts,
+ config_options,
+ to_server.clone(),
+ full_screen_ws,
+ );
*sessions.write().unwrap() = Some(session_data);
sessions
.read()
@@ -150,6 +155,7 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>) -> thread::JoinHandle<()> {
fn init_session(
os_input: Box<dyn ServerOsApi>,
opts: CliArgs,
+ config_options: Options,
to_server: SenderWithContext<ServerInstruction>,
full_screen_ws: PositionAndSize,
) -> SessionMetaData {
@@ -208,9 +214,16 @@ fn init_session(
Some(os_input.clone()),
);
let max_panes = opts.max_panes;
+ let options = opts.option;
move || {
- screen_thread_main(screen_bus, max_panes, full_screen_ws);
+ screen_thread_main(
+ screen_bus,
+ max_panes,
+ full_screen_ws,
+ options,
+ config_options,
+ );
}
})
.unwrap();