Repository navigation
fix(interpreter): close Oils word-split, globignore, dbracket, cd and alias gaps - #2641
Merged
Merged
Conversation
… alias gaps
Field splitting splits only expansion results: literal text, quoted parts
(including single quotes and empty quotes) and quoted text in a used
${v:-...} operand stay whole. Unquoted $*/$@ join on IFS[0] and split; a
null IFS keeps one field per parameter. ${#v} splits; ${!a[*]} and
${!prefix*} are distinct from their @ forms. "a"$((..)) / "a"$(..) read
their expansion whole; [\\]_ and *\(\) lex as bash does.
GLOBIGNORE filters glob matches (FNM_PATHNAME, dotglob on, . and ..
dropped). [[ ]] is checked against bash's conditional grammar at parse
time (status 2), quoted '!'/'(' are operands, newlines are blanks,
FOO=x [[ runs a command, and $(...) stderr follows the redirects.
cd gains -L/-P/--, CDPATH, cd - printing, bash's errors; pwd -P.
alias/unalias accept --/-p, trailing-blank chaining continues, prefix
assignments survive, backquoted args re-parse, expansion syntax errors
exit 2. Word Display prints command substitutions as shell text.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 0c3b32d | Commit Preview URL Branch Preview URL |
Oct 08 2026, 11:57 AM |
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.
Requested by Михайло · project thread
What changed
$x""keeps an empty field, quoted text in${v:-"..."}stays whole, unquoted$*/$@join on the first IFS char then split,${#v}splits."a"$((k++)),"a"$(cmd)and"a"${x:-y z}no longer get cut short;[\\]and*\(\)match literally.:-separated patterns (brackets respected), whole-path match,./..dropped, non-empty value enables dotglob, empty result falls back like bash.[[ ]]: parse-time grammar check gives bash's syntax errors with status 2; newlines are blanks; quoted'!'/'('are operands;FOO=bar [[is a command lookup (127).-L/-P/-e/-@/--,too many arguments,OLDPWD not set, CDPATH,cd -prints,cd nope/..fails,pwd -P.alias --/-p,unalias --, trailing-blank chaining, prefix assignments kept, backquoted args re-parse (WordDisplayno longer uses Debug for command substitutions, TM-INF-022).Why
Level-up roadmap: the first Oils harness run ranked these among the biggest gaps.
Before / After (verified)
Upstream Oils spec suite (
scripts/oils-spec/run.py), misses among cases real bash passes:No new misses in any other spec file (full fails list diffed). Saved run committed for
/benches.Spot check, output identical in bash 5.2 and this branch:
Risk
depth_32_no_stack_overflow: 1,892,032 vs main 1,896,064 bytes (alias expansion boxed and only called for defined aliases).$PWDnot user-settable,globskipdots, tilde on the right of=~.Checklist
Generated by Claude Code