Repository navigation
Closed
Description
What happens
After login, the Workspaces widget shows "AeroSpace is not on your login shell's PATH." although aerospace is at /opt/homebrew/bin/aerospace and the login shell's PATH includes /opt/homebrew/bin. It stays that way until StableBar is relaunched; Reconnect doesn't help. Script widgets that call Homebrew tools are affected the same way.
Steps to reproduce
Not run yet; these follow from the code.
- Make the login shell take more than 10 seconds, for example
sleep 11in~/.zprofile. - Launch StableBar with a workspaces widget and AeroSpace installed with Homebrew.
- The widget reports that AeroSpace is not on the login shell's PATH.
Expected
StableBar waits longer or reads the login shell's environment again, and recovers without a relaunch.
Environment
- StableBar 0.9.0-beta.20261028072222.447
- macOS 27.2 (26B123)
- AeroSpace 0.21.3-Beta from Homebrew
- StableBar starts as a login item, about a minute after boot.
~/.zprofilerunsbrew shellenv, twosecurity find-generic-passwordlookups and nvm.
Evidence
- The running bar's launch environment is launchd's:
PATH=/usr/bin:/bin:/usr/sbin:/sbin. --queryshowed"modeConnectionError": "AeroSpace is not on your login shell's PATH.".- Unified log for that boot: the bar's
zshstarted at 11:01:30.5, itssecuritylookups ran at 11:01:33, and the bar's widgets started at about 11:01:41 (first EventKit request at 11:01:41.0). That is about 10.5 s after the shell started, which matches the 10 s timeout. - Run again later, the same
zsh -lc '/usr/bin/env -0'finishes in about 1.3 s with the full PATH. - Relaunching the bar cleared it:
modeConnectionErrorbecamenulland the AeroSpace mode readmain.
Diagnosis
- Sources/StableBar/StableBarApp.swift:285:
try? await loadLoginShellEnvironment()runs once and drops any error. - Sources/StableBar/Command.swift:7-13: the read uses
runCommand's default 10 s timeout. On failure,shellEnvironmentkeeps the app's launchd environment. - Sources/StableBar/Workspaces.swift:426-431:
executable()searches only that PATH, so every retry fails the same way, and nothing reads the environment again. - Since 602f83b (v0.2.0) the environment is read once instead of for every command, so a slow first read is no longer corrected by later commands.
- docs/create-a-widget.md says the environment is read once at launch, but not that a failed read is silent.
Related
- The AeroSpace connection retries every 2 seconds forever #224 made the AeroSpace reconnect back off; it doesn't read the PATH again.
- Trigger and notification data can replace PATH and other variables widget commands rely on #5 keeps trigger data from replacing PATH; a different problem.
Triaged by Claude Code (Claude Opus 5.5).
Activity
chore(release): 0.9.0 [skip ci]
stablebar-releases commentedon Oct 29, 2026
🎉 This issue has been resolved in version 0.9.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀