You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows + Git Bash: quoted braces/globs are re-expanded, and head -N doesn't return the first N lines #4256
Thanks for rtk, the savings are real. Two things on Windows (Git Bash as the agent's shell)
made the output wrong rather than just shorter, so I had to exclude those commands:
grep/find: when rtk.exe spawns Git Bash's grep/find, already-quoted braces and globs get
expanded again (MSYS globbing of the child command line).
rtk find . -not -path './x/*' -> "paths must precede expression"
Setting MSYS=noglob fixes these two, but it's not a usable workaround: it breaks the command
line of other Windows programs launched from bash. Reproduced on 0.49.0 and 0.50.0
(eb11789 doesn't cover this case).
head -N file is rewritten to rtk read --max-lines N, which returns a summary of the
start and end of the file instead of the first N lines. An agent asking for the first
lines gets different content without noticing.
Current workaround: exclude_commands = ["head", "tail", "grep", "find"].
Happy to test a fix.
Windows/Git Bash: MSYS re-expands already-quoted grep/find args, and the head→rtk read --max-lines rewrite returns a head/tail summary instead of the first N lines.
Closing as a duplicate of #4102, which tracks the MSYS/Cygwin re-globbing of quoted braces and */? arguments with a full measurement on a real Git Bash setup and the planned fix. The head -N part is already fixed since v0.50.0: head -20 file now rewrites to rtk read file --head-lines 20 and returns exactly the first 20 lines. Please follow up on #4102, and reopen here if head -N still misbehaves on v0.50.0 or later.
Activity
rtk-wshm-sync-bot commentedon Sep 26, 2026
🔍 Automated Triage
bughighSummary
Windows/Git Bash: MSYS re-expands already-quoted grep/find args, and the head→
rtk read --max-linesrewrite returns a head/tail summary instead of the first N lines.Suggested Actions
head/cat/tailrewrites corrupt files when output is redirected, andrtk read --max-lines Nreturns ~N/2 lines #4202 (rtk read --max-lines Nreturns ~N/2 lines) — likely same underlying head/tail rewrite defecthead -Nrewrite to return the literal first N lines instead of a summary viewTriaged automatically by wshm · This is an automated analysis, not a human review.
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
KuSh commentedon Oct 3, 2026
Closing as a duplicate of #4102, which tracks the MSYS/Cygwin re-globbing of quoted braces and
*/?arguments with a full measurement on a real Git Bash setup and the planned fix. Thehead -Npart is already fixed since v0.50.0:head -20 filenow rewrites tortk read file --head-lines 20and returns exactly the first 20 lines. Please follow up on #4102, and reopen here ifhead -Nstill misbehaves on v0.50.0 or later.refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable
refactor(core): make MSYS-safe child argument encoding unforgettable