Repository navigation
fix: find tools on the login shell's PATH when the shell is slow at login - #363
Merged
Merged
Conversation
…ogin At login, a profile that runs brew shellenv, keychain lookups or nvm can take more than the 10 seconds StableBar gave the login shell. The read was then killed, its error dropped, and commands kept the app's launchd PATH until a relaunch, so Workspaces reported AeroSpace missing. The read now gets 60 seconds and retries with backoff after a failure. The bar still starts after 10 seconds at most; when the read finishes later, the store reconnects workspaces and runs scripts and providers again. Fixes #362
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #362.
StableBar reads the login shell's environment once at launch, with a 10 second limit. Right after login, a profile that runs
brew shellenv, keychain lookups or nvm can take longer than that. The read was then killed,try?dropped the error, and every command kept the app's launchdPATH=/usr/bin:/bin:/usr/sbin:/sbinuntil a relaunch. Workspaces then reported "AeroSpace is not on your login shell's PATH.", and Reconnect couldn't help.Changes
readLoginShellEnvironment()(Command.swift) gives the shell 60 seconds instead of 10. After a failed read it logs the error to stderr and retries with the provider backoff: 10 s, doubling, capped at 5 minutes.BarStore.loginShellEnvironmentLoaded()reconnects workspaces and runs every script and provider again (SENDER=startup), because they first ran without the shell'sPATH.Task.finishes(within:)waits for the read without cancelling it.This adds no configuration property, so decoding, layers, Settings, command-line edits and examples need no changes.
Testing
LoginShellEnvironmentTests.swift:finishes(within:)returns false at its limit and leaves the task running.loginShellEnvironmentLoaded()runs the script again and reconnects workspaces (mode read, connection error cleared). With the method body removed, this test fails on all three expectations.swift testpasses locally: 538 Swift Testing and 295 XCTest tests.PATH, andZDOTDIRpointing at a.zprofilethat sleeps 15 seconds before adding/opt/homebrew/bin. Polling--queryevery second showed:"modeConnectionError": "AeroSpace is not on your login shell's PATH.". This is the state from the issue."mode": "main","modeConnectionError": null, without a relaunch. The workspace loop's own retry wasn't due until about t+16.5 s, so the reconnect cleared it.Merging
One
fix:commit. A merge or rebase merge keeps it in the patch-release changelog.Claude Opus 5.5 via Claude Code.