Repository navigation
fix: read user shell from /etc/passwd when SHELL not exported - #11
Closed
joemckenney wants to merge 2 commits into
Closed
joemckenney wants to merge 2 commits into
joemckenney wants to merge 2 commits into
Conversation
On some systems (notably Fedora Atomic variants), the SHELL environment variable is set as a shell variable but not exported to the environment. This caused wake to fall back to /bin/sh, which doesn't source .bashrc, so the shell hooks never loaded and no commands were recorded. Now wake tries multiple sources for the user's shell: 1. SHELL environment variable (existing behavior) 2. /etc/passwd entry for current user (new fallback) 3. /bin/sh (final fallback) Fixes #10 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
joemckenney
marked this pull request as ready for review
February 1, 2026 17:50
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.
Summary
Improvement realized while debugging #10. The root cause of that issue was user error, but in trying to reproduce it became apparent that on Fedora Atomic (Silverblue, Kinoite, Bazzite, etc.), it seems like the
SHELLenvironment variable is set as a shell variable but not exported to the environment. This caused wake to fall back to/bin/sh, which doesn't source.bashrc, so hooks never load.Root Cause
When
std::env::var("SHELL")fails, wake fell back to/bin/sh.Fix
Now
get_user_shell()tries multiple sources:SHELLenvironment variable (existing behavior)/etc/passwdentry for current user (new fallback)/bin/sh(final fallback)Test Plan
scripts/repro-issue-10.sh)