Conversation
show_line() emitted a `<lineno>:` prefix on every match by default,
suppressed only by -N. That diverges from grep (which shows line numbers
only with -n), so `cargo test | grep "test result:"` came back as
`266:test result: ...` and broke downstream parses like
`grep X | awk -F: '{print $1}'` -- violating RTK's transparency goal
(issue #1436) and driving agent retries in benchmarking.
Line numbers now appear only when the agent requests them (-n /
--line-number); -N / --no-line-number still force them off. grep -c and
exit codes are untouched (already faithful). Tests rebased onto the
plain-grep baseline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeBpaGF4TJsNWz12h6Sk3G
match_block hardcoded `path:line:content`, so overflow recovered via a `+N more ... tail` hint carried a filename/line prefix the original grep never showed (e.g. plain single-file grep). Mirror the primary output's show_file/show_line so recovery is a faithful continuation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeBpaGF4TJsNWz12h6Sk3G
Copilot CLI names its shell tool "powershell" on Windows, so detect_format
only ever matched "bash" and fell through to PassThrough. The native
CopilotCli branch — the one returning modifiedArgs without a permissionDecision
— was therefore unreachable on Windows, leaving only the Claude-compat
PreToolUse entry to answer, which emits "ask" and prompts on every command.
Verified against a live Copilot CLI 1.0.73 session on Windows 11: the payload
delivered is {"toolName":"powershell","toolArgs":"{\"command\":\"...\"}"} —
toolArgs is already the JSON-encoded string RTK expects, only toolName differed.
Refs #3178
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-powershell-tool fix(hook): detect Copilot CLI shell tool on Windows
chore(deps): update colored to 3.1.1
fix(cicd): git app token for next release
refactor: replace `lazy_static` with `LazyLock`
TaKO8Ki
approved these changes
Jul 27, 2026
…nitialization refactor: simplify regex initialization
…line" This reverts commit 792f432. The tee block is recovery state, not command output. Mirroring the display's show_file/show_line meant a plain `rtk grep pat file` that capped at 25 of 100 matches wrote the 75 dropped ones to the tee as bare content lines: no path, no line number, nothing to open. Nobody diffs the tee against grep, so faithfulness buys nothing there and costs the one property the tee exists for. The display stays faithful, which was the point of 608e574: no -n means no line numbers, -n means line numbers, byte-identical to grep both ways. Only the recovery block goes back to being fully qualified. Also: - lock both halves with tests (match_block had none): show_line off by default / on for -n, --line-number and short clusters / off for -N, and match_block staying path:line:content when the display drops both - fix the now-false module doc in grep_faithful_format_test.rs, which still claimed byte-identity with `grep -n` and "line number always", and drop the stale _grep_n suffixes from its test names - drop a comment duplicating the show_file/show_line block above it
Strip the explanatory comments the branch accumulated and restore match_block byte-for-byte to develop, so the diff is only what the transparency fix needs: show_line() flips from opt-out to opt-in, plus tests. Compression, capping and tee recovery are untouched. Also drops a comment in run() that the flip made false.
Swapping the grep_n helper for grep_plain moved every scenario from the -n path to the plain path, leaving exactly one assertion covering line numbers. Both directions matter now that -n decides whether they appear, so assert_eq_grep_with_and_without_n runs each case twice and the piped stdin test loops over both forms. Mutation-checked: reverting show_line to the old always-on form fails 10 of the 11 tests in this file.
fix(search): display nb line only if requested
|
Adrien EPPLING seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
aeppling
approved these changes
Jul 28, 2026
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.
Feats
Fix
Other
lazy_staticwithLazyLock#3244