aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-09 16:32:26 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-09 16:32:26 +0300
commit9c4534276614653e51cfcff1fb4f9040129e8a11 (patch)
treed913a9cdce37de60cdc33476364647916c1286f0 /src
parent36b2e2f5463139a284483732131ce44977881239 (diff)
fix: preserve explicit session sockets during live handoff
refs #1180 reported-by: dvic based-on: https://github.com/dvic/herdr/pull/3
Diffstat (limited to 'src')
-rw-r--r--src/server/handoff.rs7
1 files changed, 7 insertions, 0 deletions
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(