From cc3d8393b242e50480bbc11bdbb3ecdf014c60d8 Mon Sep 17 00:00:00 2001 From: fufesou Date: Sun, 17 May 2026 00:11:49 +0800 Subject: [PATCH] fix(ipc): cmdline, try active uid when no --server processes Signed-off-by: fufesou --- src/ipc.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ipc.rs b/src/ipc.rs index 8fa7aa07c..ace56817f 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -1252,7 +1252,15 @@ fn select_server_uid_for_user_main_ipc( server_uids.dedup(); match server_uids.as_slice() { - [] => bail!("No --server process found for user main IPC"), + [] => { + if let Some(uid) = active_uid { + // If no `--server` processes are found but the active user is identifiable, + // try the active user anyway because the main process may also listen on "" IPC. + uid + } else { + bail!("No --server process found for user main IPC") + } + } [uid] => return Ok(*uid), _ => {} } @@ -1312,9 +1320,8 @@ pub async fn connect(ms_timeout: u64, postfix: &str) -> ResultType