Some filters drop or misrepresent requested data (find, ls -R, env, cargo label)
#2,271 opened on Jun 4, 2026
Description
While using RTK's filtered output, a few commands drop or misrepresent the data that was actually requested. None of these corrupt data, but each can hide requested results or mislead a reader.
1. find truncates a directory mid-listing
The --max budget is counted across directories, so the last shown directory can be cut after only some of its files while still rendered as a normal dir/ files line. The listing then looks complete and the trailing +N more is attributed to other directories. Someone checking whether a file exists in that directory is misled into thinking the directory was fully listed.
2. ls -R drops directory headers
ls -R prints one path: section per directory. The compactor flattens every section into a single list and drops the headers, so files can no longer be mapped to their directory (many distinct mod.rs entries become indistinguishable). The output can even be larger than the raw listing.
3. env silently drops secret-bearing variables
A sensitive variable that does not match a known category (cloud/tool/language) falls through every bucket and is omitted entirely, so rtk env implies it is unset — even when the user wants to confirm it is set. (Categorized secrets such as AWS_SECRET_ACCESS_KEY are already shown masked; the gap is the uncategorized ones.)
4. cargo check is labeled cargo build
CargoBuildHandler is shared by build and check, but the summary string is hardcoded to cargo build, so rtk cargo check reports cargo build (N crates compiled).
A PR with atomic commits (one fix per commit) follows.