rtk-ai / rtk-ai/rtk

Windows: `rtk tree` still corrupts arguments containing a quote — last unconverted sibling after #3728

Open Beginner friendly
#4,101 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli bug good first issue platform:windows priority:medium resolved-pending-close
Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 21h
Merged PRs (30d)
35

Description

src/cmds/system/tree.rs:35 forwards rtk's own CLI arguments to a PATH-resolved tree with plain cmd.arg:

for arg in args {
    cmd.arg(arg);
}

#3728 introduced ChildArgExt::child_arg/child_args and converted the rest of this family — ls, wc, find, grep/rg, proxy, run_passthrough and the main.rs unknown-command fallback — but tree was not converted. MSYS2 ships an MSYS-linked tree, so on Windows this reproduces #3727 exactly:

rtk tree -P '*"*'
rtk tree -I 'a"b'

The -I pattern built on line 32 from NOISE_DIRS is rtk-generated and contains no quote, so it is unaffected.

Fix is mechanical — swap the loop for cmd.child_args(args), matching wc_cmd.rs.

I checked the rest of src/cmds/system/ while reviewing #3728: read.rs's Command::new sites are all inside #[cfg(test)], pipe_cmd.rs spawns nothing, and ast_grep/ctest target native binaries. tree.rs is the only remaining gap in this family.

Follow-up from the review of #3728.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/cmds/system/tree.rs:35 and compare its argument loop with the child_args usage in wc_cmd.rs. Convert tree's forwarded arguments consistently, then verify the quoted -P and -I examples on Windows/MSYS2 no longer corrupt their arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.