Repository navigation
fix(login): report login_shell shopt as on for login shells - #911
Merged
Merged
Conversation
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.
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
The
__RUBASH_LOGIN_SHELLcarrier drove startup files andlogout, but thelogin_shellshopt stayed off on every login path (-l,--login, argv[0]-mark, lib API):Found while putting
niuon as the Termux login shell: frameworks probeshopt -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_shellfunnel (carrier + shopt together,public_accessors.rs) replacing the four bareset_envlogin markings (invocation.rslib API,main.rs-l/--loginarms and argv[0]-mark). Non-login shells untouched. New unit testlogin_invocation_reports_login_shell_shoptcovers on/off.Companion host-side one-liner (niubash
shell.rsargv[0] mark) follows in a separate niubash PR; it uses only long-stable engine APIs so it builds against the pinned rev too.