Repository navigation
fix(interpreter): match bash stderr for set -x, syntax errors and TIMEFORMAT - #2635
Merged
Merged
Conversation
…EFORMAT
set -x quotes traced words like bash, traces assignments, function calls,
eval/source and [[ ]] primaries, expands PS4 and repeats its first
character per $(...)/eval/source/trap level. Trace lines queue with the
pending $(...) stderr so they follow the substitutions that built them
and precede the command's redirects; function/eval trace lines now reach
the streaming callback.
Grammar errors are worded by the token the parser stopped at ("syntax
error near unexpected token `T'" plus the source line, or "syntax error:
unexpected end of file" on the line after the last), unterminated quotes
and an unclosed [[ =~ ( group read like bash, and reports are named
bash: -c, the script path, $0: eval or the sourced file
(Error::syntax_report). Empty if/while conditions fail at then/do.
bash/sh children apply their redirects to their own errors.
time honors TIMEFORMAT (%[p][l]R, %%; CPU fields stay unavailable).
[[ ! a || b ]] negates only a; $LINENO in [[ ]]/(( )) keeps the
enclosing list's line.
bash-oracle strict 94 -> 99/106.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | b797d71 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 08:18 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
set -xquotes traced words like bash, traces assignments, function calls, eval/source and[[ ]]terms, expands PS4 and repeats its first char per$(...)/eval/source/trap level. Trace lines are ordered with pending$(...)stderr.T'" plus the source line, "unexpected end of file", "unexpected EOF while looking for matching". Reports are namedbash: -c, the script path,$0: evalor the sourced file via newError::syntax_report`.timehonorsTIMEFORMAT(%[p][l]R,%%; CPU fields print unavailable).[[ ! a || b ]]negates onlya;$LINENOin[[ ]]/(( ))keeps the enclosing line; bash/sh children apply their redirects to their own errors.Why
Level-up roadmap, fidelity step: stderr text was the main remaining gap in the bash oracle.
Before / After (verified)
bash-oracle strict: 94 → 99 / 106 (match stays 101).
floor.txtraised to101 99.Script
set -x; x="a b"; echo "$x" 'it''s'; y=$(echo hi)plusbash -c 'if then fi', stderr from bash 5.2 and this branch is identical:Before, traces were unquoted with no assignment lines, and parse errors used bashkit's own parser wording.
Risk
Error::syntax_reportis new public API.knowledge/operations/limitations.md(no trace of for/case/select headers,<(...), some parse errors keep bashkit wording).Checklist
Generated by Claude Code