You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accepts ripgrep’s --color modes and the -- option terminator so sandbox clients can use the same color-safe invocation with real ripgrep and just-bash.
Also matches ripgrep’s heading behavior for one explicitly named file. Adds focused unit coverage and comparison fixtures recorded from real ripgrep.
Automated, advisory triage for @matchai's PR. Facts below are read from the GitHub API.
Check
Result
Author's merged PRs (this repo)
1
Account established
✅ (age 4850d · 1176 followers · 165 public repos)
Commits signed/verified
✅ 2/2
Changeset included
✅ (.changeset/rg-color-option.md)
Review panel: 🟡 medium highest severity
just-bash maintainer code review: 🟡 medium
The core invocation works, but option termination is incomplete and two accepted color modes have incorrect semantics.
packages/just-bash/src/commands/rg/rg.ts:98 — The raw-argument checks for `--help` and `--type-list` run before terminator-aware parsing, so tokens after `--` still trigger special modes instead of becoming positional arguments.
packages/just-bash/src/commands/rg/rg-parser.ts:163 — `--color` accepts `always` and `ansi` but discards the mode, producing plain text even though both modes explicitly force colored output in ripgrep. Implement forced coloring or reject these unsupported modes.
General code review: 🟡 medium
The new common invocation works, but option termination is incomplete and two accepted color modes silently violate their advertised semantics.
packages/just-bash/src/commands/rg/rg.ts:98 — The option terminator is bypassed by the pre-parse checks: `rg -- --help file` returns help, and `rg -- --type-list file` lists types, instead of treating those tokens as the positional pattern. These special flags must only be recognized before the first `--`.
packages/just-bash/src/commands/rg/rg-parser.ts:161 — All color modes are accepted but discarded, so `--color=always` and `--color=ansi` produce uncolored output despite those modes explicitly requiring ANSI output in ripgrep. Either implement their semantics or reject/document only the no-color compatibility modes.
Adversarial security: 🟡 medium
Option termination does not fully prevent positional arguments from being interpreted as control flags.
packages/just-bash/src/commands/rg/rg.ts:98 — The new `--` terminator is bypassed by raw pre-parsing for `--help` and `--type-list`. For example, `rg -- --help file` returns help instead of searching, allowing an attacker-controlled pattern or path after the terminator to hijack the operation and produce successful unrelated output.
Adversarial security (second opinion): 🟢 low
Small, well-scoped rg compatibility change: adds `--color` as a validated no-op flag, implements the `--` option terminator, and suppresses the `--heading` filename line for a single explicitly named file. No new networking, process execution, filesystem, or dependency surface; the `--` handling is single-shot and correctly falls through to positional parsing, `--color` is stored nowhere (no injection path) and its accepted values/error text match ripgrep 14, and the heading change is corroborated by a comparison fixture whose id hash matches its recorded command/files. No actionable defects found.
Standard Bash and host portability: 🟢 low
No actionable Bash or host-portability issues found.
Posted by auto-maintain. This automated code review is advisory; a human maintainer makes the call.
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
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.
Accepts ripgrep’s
--colormodes and the--option terminator so sandbox clients can use the same color-safe invocation with real ripgrep and just-bash.Also matches ripgrep’s heading behavior for one explicitly named file. Adds focused unit coverage and comparison fixtures recorded from real ripgrep.