From 9c4534276614653e51cfcff1fb4f9040129e8a11 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 9 Jul 2026 16:32:26 +0300 Subject: fix: preserve explicit session sockets during live handoff refs #1180 reported-by: dvic based-on: https://github.com/dvic/herdr/pull/3 --- src/server/handoff.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/server/handoff.rs b/src/server/handoff.rs index 2be36c2a..d17bfa91 100644 --- a/src/server/handoff.rs +++ b/src/server/handoff.rs @@ -80,6 +80,13 @@ pub(crate) fn spawn_handoff_import( .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()); + if crate::session::explicit_session_requested() { + // The import child no longer has the original `--session` argument, so + // stale socket overrides must not mask the inherited HERDR_SESSION. + command + .env_remove(crate::api::SOCKET_PATH_ENV_VAR) + .env_remove(crate::server::socket_paths::CLIENT_SOCKET_PATH_ENV_VAR); + } crate::platform::detach_server_daemon_command(&mut command); command.spawn().map_err(|err| { io::Error::new( -- cgit v1.2.3