Repository navigation
fix(tracking): store commands so they read back as the same words - #4403
Merged
Merged
Conversation
📊 Automated PR Analysis
SummaryFixes command tracking so stored commands preserve word boundaries by quoting only words that need it (like shlex.quote), instead of naively joining argv with spaces. Adds a shared Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
1 of 2 tasks
TaKO8Ki
self-requested a review
October 5, 2026 16:57
TaKO8Ki
approved these changes
Oct 5, 2026
TaKO8Ki
left a comment
Collaborator
There was a problem hiding this comment.
After resolving the conflicts, it looks good to me.
KuSh
force-pushed
the
fix/tracked-command-quoting
branch
2 times, most recently
from
October 6, 2026 21:52
b4bea1c to
421510e
Compare
Tracked commands quote each argv word the way shlex.quote does, so `grep -n 'a b' f` and `grep -n a b f` stay distinct and `foo()` is not stored as shell syntax. A word starting with `=` is quoted too, and so is a program word a shell would not run as a program (`NAME=value`, or a reserved word such as `time`). A passthrough run is recorded as `rtk:passthrough <command>`. Words made only of safe characters are written as they are, so plain commands look the same in `rtk gain --history`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
KuSh
force-pushed
the
fix/tracked-command-quoting
branch
from
October 6, 2026 22:02
421510e to
87d1b18
Compare
Merged
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.
rtk gain --historyandrtk discoverread back the command each handler records. Handlers built that string by joining argv with spaces, which loses word boundaries:grep -n 'a b' fandgrep -n a b fwere stored the same, andgrep 'foo()' fwas stored as shell syntax.core/shell.rs(with_args, on top ofdisplay_args) quotes only the words that need it, asshlex.quotedoes. Plain commands look the same as before.src/for a tracked label built by joining words with a space, so a new one fails CI.rtk:passthrough <command>instead of<command> (passthrough).Nothing changes in what rtk executes; only what it records.
Test plan
cargo fmt --all --check && cargo clippy --all-targets -- -D warnings && cargo test --allgreen on the rebased commitwincheck.sh(cfg(windows) type-check) clean', the empty word, non-ASCII) and for the stored labels offind, passthrough runs and old rows🤖 Generated with Claude Code