Apply login-shell -l flag when args array is empty#40
Merged
Conversation
Empty arrays are truthy in JS, so `explicitArgs || resolveLoginArg(...)` preserved the empty array and skipped the -l fallback. detectAvailableShells returns args:[] on Unix, which propagates through the default-shell flow, so on standalone macOS the spawned zsh ran without -l. ~/.zprofile was skipped, /opt/homebrew/bin never landed on PATH, and asdf's precmd hook emitted "command not found: asdf" on every prompt. VS Code hid the bug by hydrating its own env from a login shell at startup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
3259b8b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e241c349.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-standalone-login-shell-a.mouseterm.pages.dev |
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
resolveSpawnConfigusedexplicitArgs || resolveLoginArg(...). Empty arrays are truthy in JS, so anargs: []fromdetectAvailableShells(the default on Unix) suppressed the-lfallback and the shell launched without login mode.~/.zprofile, soeval "$(brew shellenv)"never ran and/opt/homebrew/binwas missing from PATH.~/.zshrcstill loaded asdf's java plugin, and its precmd hook printedasdf_update_java_home:2: command not found: asdfon every prompt.-l.argsarray as "no override" and fall through toresolveLoginArg. Updated the test that pinned the buggy behavior; added a regression test for the macOS/zsh case and one that confirms non-empty explicit args (e.g. WSL-d <distro>) still pass through unchanged.Test plan
node --test standalone/sidecar/pty-core.test.js— 18/18 passasdf_update_java_home:2: command not found: asdfecho $PATHinside a standalone terminal includes/opt/homebrew/binand the asdf shims directory🤖 Generated with Claude Code