aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-client/src
diff options
context:
space:
mode:
authordivens <divens@users.noreply.github.com>2026-02-23 08:59:52 +0100
committerGitHub <noreply@github.com>2026-02-23 08:59:52 +0100
commitb3b4aa8ccbcdfcc9580c329f09bf2109841c783b (patch)
tree32ac7be664a31a2e8e7a28df697828fa04aa198b /zellij-client/src
parentfix: set scroll region to viewport size when resizing in alternate screen (#4... (diff)
downloadsl0ppij-b3b4aa8ccbcdfcc9580c329f09bf2109841c783b.tar.gz
sl0ppij-b3b4aa8ccbcdfcc9580c329f09bf2109841c783b.tar.xz
sl0ppij-b3b4aa8ccbcdfcc9580c329f09bf2109841c783b.zip
[Windows port PR6] refactor: gate daemonization and shell-related functions for cross-platform support (#4746)
* refactor: abstract daemonization behind cfg gates Gate Unix-only daemonize/nix usage with #[cfg(unix)], add non-Unix foreground fallback for web server, remove unused libc dep from both crates, and move daemonize/nix to cfg(unix) dependencies. * refactor: abstract shell invocation and process listing Gate get_default_shell() with cfg(not(windows)) and add a Windows stub. Split run_command_hook() with cfg(not(windows)) for the sh -c path and a Windows stub. Add cfg(unix) gate on the ps-based get_all_cmds_by_ppid() with a non-Unix stub. --------- Co-authored-by: divens <divens.dev@gmail.com>
Diffstat (limited to 'zellij-client/src')
-rw-r--r--zellij-client/src/web_client/mod.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/zellij-client/src/web_client/mod.rs b/zellij-client/src/web_client/mod.rs
index 0ef47302..958de439 100644
--- a/zellij-client/src/web_client/mod.rs
+++ b/zellij-client/src/web_client/mod.rs
@@ -28,11 +28,16 @@ use tokio::runtime::Runtime;
use axum_server::tls_rustls::RustlsConfig;
use axum_server::Handle;
+#[cfg(unix)]
use daemonize::{self, Outcome};
+#[cfg(unix)]
+use interprocess::unnamed_pipe::pipe;
+#[cfg(unix)]
use nix::sys::stat::{umask, Mode};
-use interprocess::unnamed_pipe::pipe;
-use std::io::{prelude::*, BufRead, BufReader};
+use std::io::prelude::*;
+#[cfg(unix)]
+use std::io::{BufRead, BufReader};
use zellij_utils::input::{config::Config, options::Options};
use authentication::auth_middleware;
@@ -247,6 +252,7 @@ pub async fn serve_web_client(
}
}
+#[cfg(unix)]
fn daemonize_web_server(
web_server_ip: IpAddr,
web_server_port: u16,
@@ -348,6 +354,16 @@ fn daemonize_web_server(
}
}
+#[cfg(not(unix))]
+fn daemonize_web_server(
+ _web_server_ip: IpAddr,
+ _web_server_port: u16,
+ _web_server_cert: Option<PathBuf>,
+ _web_server_key: Option<PathBuf>,
+) -> (Runtime, std::net::TcpListener, Option<RustlsConfig>) {
+ unimplemented!("Non-Unix web server not yet implemented")
+}
+
#[cfg(test)]
#[path = "./unit/web_client_tests.rs"]
mod web_client_tests;