From 7f2185f0501a342a344f1c33216580f39d858606 Mon Sep 17 00:00:00 2001 From: Joel Teply Date: Tue, 28 Apr 2026 00:58:03 -0500 Subject: [PATCH] fix(airc daemon): scope tracks cwd at install time, not always $HOME/.airc PR #200 follow-up. _daemon_scope was returning ${AIRC_HOME:-$HOME/.airc} unconditionally, but actual user state lives in $cwd/.airc per detect_scope(). So 'airc daemon install' from ~/continuum/ captured the wrong scope (~/.airc, empty), spawned a monitor that connected to nothing, user appeared offline despite 'RUNNING (PID xxx)' in status. Mirror detect_scope's logic exactly: AIRC_HOME if set, else cwd/.airc. Now 'airc daemon install' from a project dir captures THAT dir's .airc as the daemon's scope, launcher .bat sets AIRC_HOME=that, the spawned airc connect uses the right room state. Joel 2026-04-28 ~01:05Z caught this: 'lol obv if it worked you would have a monitor and be online. FAIL'. --- airc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/airc b/airc index 98e5d5c..04951af 100755 --- a/airc +++ b/airc @@ -4876,10 +4876,19 @@ _daemon_airc_path() { fi } -# The scope the daemon will run under. If AIRC_HOME is set at install time, -# that's recorded in the unit/plist so future starts use the same scope. +# The scope the daemon will run under. Mirrors detect_scope() (line 135) +# so `airc daemon install` from a project dir captures THAT dir's +# .airc as the daemon's scope -- otherwise the daemon spawns a monitor +# pointed at $HOME/.airc (empty / wrong room) while the user's actual +# join state lives at $cwd/.airc. Joel 2026-04-28: "lol obv if it +# worked you would have a monitor and be online. FAIL" -- caught the +# scope mismatch on continuum-b69f's box. _daemon_scope() { - echo "${AIRC_HOME:-$HOME/.airc}" + if [ -n "${AIRC_HOME:-}" ]; then + echo "$AIRC_HOME" + else + echo "$(pwd -P)/.airc" + fi } # Returns 0 if the autostart daemon (launchd / systemd unit) is installed