summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock25
-rw-r--r--src/common/mod.rs5
-rw-r--r--src/server/mod.rs15
-rw-r--r--src/tests/fakes.rs2
4 files changed, 25 insertions, 22 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b66f3f28e..95648ec2e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -333,12 +333,6 @@ dependencies = [
]
[[package]]
-name = "colors-transform"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9226dbc05df4fb986f48d730b001532580883c4c06c5d1c213f4b34c1c157178"
-
-[[package]]
name = "concurrent-queue"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -361,12 +355,6 @@ dependencies = [
]
[[package]]
-name = "const_fn"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6"
-
-[[package]]
name = "cpuid-bool"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1569,6 +1557,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
+name = "socket2"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
name = "stable_deref_trait"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2331,7 +2329,6 @@ dependencies = [
"async-std",
"backtrace",
"bincode",
- "colors-transform",
"directories-next",
"futures",
"insta",
@@ -2355,8 +2352,6 @@ dependencies = [
"vte 0.8.0",
"wasmer",
"wasmer-wasi",
- "zellij-tile",
- "zellij-tile-extra",
]
[[package]]
diff --git a/src/common/mod.rs b/src/common/mod.rs
index a5c004f9f..d003aab0f 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -228,10 +228,11 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs, config: Config) {
let mut send_app_instructions =
SenderWithContext::new(err_ctx, SenderType::SyncSender(send_app_instructions));
- let ipc_thread = start_server(os_input.clone(), opts.clone());
+ let (ipc_thread, server_name) = start_server(os_input.clone(), opts.clone());
let (client_buffer_path, client_buffer) = SharedRingBuffer::create_temp(8192).unwrap();
- let mut send_server_instructions = IpcSenderWithContext::to_server();
+ let mut send_server_instructions =
+ IpcSenderWithContext::new(SharedRingBuffer::open(&server_name).unwrap());
send_server_instructions
.send(ServerInstruction::NewClient(client_buffer_path))
.unwrap();
diff --git a/src/server/mod.rs b/src/server/mod.rs
index fef663663..794066b05 100644
--- a/src/server/mod.rs
+++ b/src/server/mod.rs
@@ -14,7 +14,7 @@ use std::path::PathBuf;
use std::sync::mpsc::channel;
use std::thread;
-pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHandle<()> {
+pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> (thread::JoinHandle<()>, String) {
let (send_pty_instructions, receive_pty_instructions): ChannelWithContext<PtyInstruction> =
channel();
let mut send_pty_instructions = SenderWithContext::new(
@@ -22,7 +22,13 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand
SenderType::Sender(send_pty_instructions),
);
- let server_buffer = SharedRingBuffer::create(ZELLIJ_IPC_PIPE, 8192).unwrap();
+ #[cfg(not(test))]
+ let (server_name, server_buffer) = (
+ String::from(ZELLIJ_IPC_PIPE),
+ SharedRingBuffer::create(ZELLIJ_IPC_PIPE, 8192).unwrap(),
+ );
+ #[cfg(test)]
+ let (server_name, server_buffer) = SharedRingBuffer::create_temp(8192).unwrap();
let (send_os_instructions, receive_os_instructions): ChannelWithContext<OsApiInstruction> = channel();
let mut send_os_instructions = SenderWithContext::new(
@@ -114,7 +120,7 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand
})
.unwrap();
- thread::Builder::new()
+ let join_handle = thread::Builder::new()
.name("ipc_server".to_string())
.spawn({
let recv_server_instructions = IpcReceiver::new(server_buffer);
@@ -188,5 +194,6 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> thread::JoinHand
}
}
})
- .unwrap()
+ .unwrap();
+ (join_handle, server_name)
}
diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs
index 684a24a7d..8e4aff25c 100644
--- a/src/tests/fakes.rs
+++ b/src/tests/fakes.rs
@@ -13,7 +13,7 @@ use zellij_tile::data::Palette;
use crate::tests::utils::commands::{QUIT, SLEEP};
-const MIN_TIME_BETWEEN_SNAPSHOTS: Duration = Duration::from_millis(50);
+const MIN_TIME_BETWEEN_SNAPSHOTS: Duration = Duration::from_millis(300);
#[derive(Clone)]
pub enum IoEvent {