Skip to content

fix(capture): use platform-appropriate cmdline quoting for child app args#258

Merged
BANANASJIM merged 1 commit into
masterfrom
fix/257-windows-arg-quoting
Jun 23, 2026
Merged

fix(capture): use platform-appropriate cmdline quoting for child app args#258
BANANASJIM merged 1 commit into
masterfrom
fix/257-windows-arg-quoting

Conversation

@BANANASJIM

Copy link
Copy Markdown
Owner

Closes #257.

Problem

rdc capture -- <exe> <args> built the child command line with POSIX shlex.join, which single-quotes any argument containing a backslash. On Windows, ExecuteAndInject delegates to CommandLineToArgvW, which does not recognise POSIX single-quoting, so a path like D:\path\script.das reached the target process as the literal 'D:\path\script.das' and the launch failed.

Fix

Add join_cmdline(args) to rdc._platform, dispatching on the existing _WIN flag:

  • Windows: subprocess.list2cmdline (the reference encoder that CommandLineToArgvW parses back).
  • POSIX: shlex.join (unchanged behaviour).

Both call sites in commands/capture.py are rerouted; the now-unused shlex import is removed. The remote path forwards a single verbatim string and is correctly out of scope.

Tests

tests/unit/test_platform.py::TestJoinCmdline (6 cases) covers both branches, including the regression: a backslash path is not single-quoted on Windows.

pixi run lint && pixi run typecheck && pixi run test: all green (2996 passed, 6 skipped, 92.82% coverage).

…args

shlex.join produces POSIX single-quote quoting which Win32 CommandLineToArgvW
does not understand. Route both call sites through _platform.join_cmdline,
which dispatches to subprocess.list2cmdline on Windows and shlex.join on POSIX.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@BANANASJIM, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 34 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: df610d59-fcc8-4dcf-a258-c7e768e3f6e8

📥 Commits

Reviewing files that changed from the base of the PR and between 805efa1 and b4e01a3.

📒 Files selected for processing (6)
  • openspec/changes/2026-06-22-fix-257-windows-arg-quoting/proposal.md
  • openspec/changes/2026-06-22-fix-257-windows-arg-quoting/tasks.md
  • openspec/changes/2026-06-22-fix-257-windows-arg-quoting/test-plan.md
  • src/rdc/_platform.py
  • src/rdc/commands/capture.py
  • tests/unit/test_platform.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/257-windows-arg-quoting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BANANASJIM
BANANASJIM merged commit c88ee5c into master Jun 23, 2026
17 checks passed
@BANANASJIM
BANANASJIM deleted the fix/257-windows-arg-quoting branch July 1, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: rdc capture mangles child app args via POSIX shlex.quote (backslash paths get literally single-quoted)

1 participant