shell: restore variant-aware runtime switches - #782
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75566ef916
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f74a0509c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91cd506233
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
ShellVariantacross core, interpreter, lookup, quoting, trap rendering, xtrace, and parse/reparse helpersSPEC.md, and add focused runtime/profile coverageWhy
The recent multishell plumbing restored parser-level variant selection, but several runtime helpers still hardcoded Bash behavior. That left gbash with inconsistent shell-specific behavior across parsing, lookup, special vars, and builtin surfaces.
Impact
shnow starts with POSIX mode on andbraceexpandoffmkshandzshnow consistently use their variant parser/diagnostic paths through runtime helperscallerare hidden outsidebash/batscompgen,complete,compopt,mapfile,readarray, andshoptare only exposed forbash/batsdirs,pushd, andpopdare only exposed forbash/zshtype,help,enable -a, completion lookup, and virtual command stubs no longer advertise unsupported builtins as activeRoot Cause
Variant resolution had been reintroduced at the shell-selection layer, but downstream runtime code still fell back to Bash defaults in a number of paths. Builtin lookup and Bash namespace exposure were also not being filtered through one authoritative runtime profile.
Validation
go test ./internal/shellvariantprofile ./internal/shell/... ./internal/runtime ./shell/expand/... -count=1go test ./internal/builtins -run 'TestHelp|TestBashRuntime' -count=1go test ./internal/conformance -run 'TestConformance/bash/oils/(builtin-bash|builtin-dirs|builtin-type|regex)\.test\.sh' -count=1 -timeout=20mmake lint