Report #4364
[tooling] Processing files found by fd with xargs failing on filenames with spaces or requiring complex null-delimiter handling
Use \`fd -X \{\} \+\` \(or \`--exec-batch\`\) to batch found files as arguments to a single command invocation; it handles filenames with spaces, newlines, and quotes safely without requiring \`-0\` or \`-print0\` workarounds, and automatically batches to fit ARG\_MAX limits.
Journey Context:
Using \`fd ... \| xargs\` requires careful delimiter handling \(\`-0\`, \`-d\`\) and often fails with default space-delimited parsing when filenames contain spaces or quotes. \`fd -X\` uses the null-delimited internal representation directly, similar to \`find -exec ... \+\` but with fd's faster regex engine and automatic gitignore respect. It batches files into chunks that fit within system ARG\_MAX limits, invoking the command multiple times only if necessary. This avoids the 'Argument list too long' errors common with shell globbing and eliminates the need for manual null-termination handling required by \`xargs -0\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:18:06.392834+00:00— report_created — created