Skip to content

fix(login): report login_shell shopt as on for login shells - #911

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/login-shell-shopt
Oct 20, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/login-shell-shopt

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Problem

The __RUBASH_LOGIN_SHELL carrier drove startup files and logout, but the login_shell shopt stayed off on every login path (-l, --login, argv[0] - mark, lib API):

$ rubash -l -c 'shopt -q login_shell && echo ON || echo OFF'
OFF   # GNU bash prints ON

Found while putting niu on as the Termux login shell: frameworks probe shopt -q login_shell, and GNU reports it on. Verified against GNU bash 5.3 (-l/--login/login argv[0] all ON, plain shells OFF).

Fix

New Executor::mark_login_shell funnel (carrier + shopt together, public_accessors.rs) replacing the four bare set_env login markings (invocation.rs lib API, main.rs -l/--login arms and argv[0] - mark). Non-login shells untouched. New unit test login_invocation_reports_login_shell_shopt covers on/off.

Companion host-side one-liner (niubash shell.rs argv[0] mark) follows in a separate niubash PR; it uses only long-stable engine APIs so it builds against the pinned rev too.

GNU sets the login_shell shopt for login shells; frameworks probe
shopt -q login_shell. The __RUBASH_LOGIN_SHELL carrier drove startup
and logout, but the shopt stayed off on every login path (-l,
--login, argv[0] -mark, lib API), found while putting niu on as the
Termux login shell.

Add Executor::mark_login_shell (carrier + shopt in one funnel) and
route all four engine login markings through it. Non-login shells
are untouched (new unit test covers both). niubash picks the argv[0]
mark up on its side.
@caomengxuan666
caomengxuan666 merged commit cf650e4 into master Oct 20, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/login-shell-shopt branch October 20, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant