Skip to content

Commit

Permalink
fixup! attach palette to SessionMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kenji committed May 30, 2021
1 parent 55bfe09 commit 27b1555
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion zellij-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::path::PathBuf;
use std::sync::{Arc, Mutex, RwLock};
use std::thread;
use wasmer::Store;
use zellij_tile::data::{Event, InputMode, PluginCapabilities};
use zellij_tile::data::{Event, InputMode,Palette, PluginCapabilities};

use crate::{
os_input_output::ServerOsApi,
Expand Down Expand Up @@ -84,6 +84,7 @@ impl ErrorInstruction for ServerInstruction {
pub(crate) struct SessionMetaData {
pub senders: ThreadSenders,
pub capabilities: PluginCapabilities,
pub palette: Palette,
screen_thread: Option<thread::JoinHandle<()>>,
pty_thread: Option<thread::JoinHandle<()>>,
wasm_thread: Option<thread::JoinHandle<()>>,
Expand Down Expand Up @@ -400,6 +401,7 @@ fn init_session(
to_server: None,
},
capabilities,
palette: client_attributes.palette,
screen_thread: Some(screen_thread),
pty_thread: Some(pty_thread),
wasm_thread: Some(wasm_thread),
Expand Down
4 changes: 2 additions & 2 deletions zellij-server/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use zellij_utils::{
fn route_action(
action: Action,
session: &SessionMetaData,
os_input: &dyn ServerOsApi,
_os_input: &dyn ServerOsApi,
to_server: &SenderWithContext<ServerInstruction>,
) -> bool {
let mut should_break = false;
Expand All @@ -34,7 +34,7 @@ fn route_action(
.unwrap();
}
Action::SwitchToMode(mode) => {
let palette = os_input.load_palette();
let palette = session.palette;
// TODO: use the palette from the client and remove it from the server os api
// this is left here as a stop gap measure until we shift some code around
// to allow for this
Expand Down

0 comments on commit 27b1555

Please sign in to comment.