Skip to content

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

Closed

Description

@KuSh

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.

Activity

  1. rtk-wshm-sync-bot commented on Sep 18, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 95%

    Summary

    tree.rs still forwards args via plain cmd.arg instead of child_args, corrupting quoted args on Windows/MSYS2; swap to ChildArgExt::child_args as done in #3728 sibling commands

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/cmds/system/tree.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  2. KuSh commented on Sep 18, 2026

    @KuSh
    CollaboratorAuthor

    Fixed on develop by #3728 (merged as 0924356), which converted this call site:

    // src/cmds/system/tree.rs:35
    -    for arg in args {
    -        cmd.arg(arg);
    -    }
    +    cmd.child_args(args);

    The rtk-generated -I <NOISE_DIRS> flag above it stays on plain arg, which is correct — it is rtk's own string and contains no quote, so it never reaches the re-encoding branch.

    Not closing yet: the fix is on develop but not in any published build. The newest pre-release, dev-0.50.0-rc.443, was cut at 2026-09-18T22:37Z and the merge landed at 23:11Z, so no released artifact contains it. Labelling resolved-pending-close; this closes once a release ships it.

  3. added
    resolved-pending-close
    on Sep 18, 2026
  4. 14 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibuggood first issueplatform:windowspriority:mediumresolved-pending-close

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions