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
rtk ls with multiple directory arguments omits per-directory headers #2857
rtk ls dirA dirB (and any N-directory invocation) flattens every directory's entries into one list with no per-directory attribution, unlike native ls, which prints a path: header before each directory's listing. A file can appear to belong to the first directory listed when it actually came from another.
This is distinct from #2271 / PR #2272, which fixes header loss for ls -R (single-directory recursive). The case here is triggered by passing multiple directory operands to non-recursive ls, so it isn't covered by that fix.
Repro
$ mkdir -p dirA dirB && echo a1 > dirA/file_a.txt && echo b1 > dirB/file_b.txt
$ ls dirA dirB
dirA:
file_a.txt
dirB:
file_b.txt
$ rtk ls dirA dirB
file_a.txt 3B
file_b.txt 3B
Expected: output preserves the per-directory path: headers (or equivalent attribution) that native ls prints whenever more than one directory operand is given.
Actual: entries from all directories are merged into a single flat list with no indication of which directory each file came from.
Impact
Deterministic whenever more than one directory is passed and at least one is non-empty. Misleads any check that depends on directory membership (e.g. "did file X land in stage A or stage B of a pipeline") into attributing a file to the wrong directory, since the merged list reads as if everything came from the first path.
Environment
rtk 0.43.0, Windows (Git Bash).
Workaround
rtk proxy ls dirA dirB (unfiltered passthrough) or one directory at a time via rtk proxy ls <dir>.
rtk ls with multiple directory arguments merges all entries into one flat list without per-directory 'path:' headers like native ls; add per-directory attribution for multi-operand ls calls.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/ls_cmd.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Confirmed with long listings on Ubuntu 26.04.1 LTS x86-64, RTK 1.2.1 full release. Short multi-directory output preserved both headings in this fixture. Long output lost both, so the listing no longer identifies the directory containing y.
# In an empty directoryexport LC_ALL=C
mkdir -p a/d b
printf'content\n'> a/x
touch b/y
chmod 755 a/d
chmod 644 a/x b/y
ls -l a b | sed -n '/^[ab]:$/p'
rtk ls -l a b | sed -n '/^[ab]:$/p'
Expected and observed from native:
a:
b:
The RTK heading check produced zero lines. Before the heading filter, the RTK listing contained 755 d/, 644 x 8B, and 644 y 0B, followed by its filtering and recall notices.
Activity
pszymkowiak commentedon Jul 7, 2026
🔍 Automated Triage
bugmediumSummary
rtk ls with multiple directory arguments merges all entries into one flat list without per-directory 'path:' headers like native ls; add per-directory attribution for multi-operand ls calls.
📁 Relevant files
src/ls_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
NickSpag commentedon Jul 16, 2026
reproduced on macos
SNComrade commentedon Nov 26, 2026
Confirmed with long listings on Ubuntu 26.04.1 LTS x86-64, RTK 1.2.1 full release. Short multi-directory output preserved both headings in this fixture. Long output lost both, so the listing no longer identifies the directory containing
y.Expected and observed from native:
The RTK heading check produced zero lines. Before the heading filter, the RTK listing contained
755 d/,644 x 8B, and644 y 0B, followed by its filtering and recall notices.