Summary
In rtk ls, the -a flag has no effect on which entries are listed, and -1 — which should only control one-entry-per-line formatting — is what determines whether hidden entries appear. The result is that three of the four common flag combinations disagree with native ls.
Environment
- rtk 0.45.0 (Homebrew)
- macOS 26.3.1, arm64
- Default config; no
ls alias; LANG unset, LC_COLLATE=C
Reproduction
mkdir -p /tmp/rtkrepro && cd /tmp/rtkrepro
touch visible.txt .hidden
| form |
native ls |
rtk ls |
correct? |
| (no flags) |
visible.txt |
.hidden visible.txt |
no — shows a dotfile that should be hidden |
-1 |
visible.txt |
. .. .hidden visible.txt |
no — adds ., .. and a dotfile |
-a |
. .. .hidden visible.txt |
.hidden visible.txt |
no — omits . and .. |
-1a |
. .. .hidden visible.txt |
. .. .hidden visible.txt |
yes |
Deterministic across repeated runs. Exit code is 0 in all cases.
Expected
rtk ls should honour -a for hidden-entry inclusion, and -1 should affect formatting only. Concretely: without -a, entries beginning with . should be omitted; with -a, . and .. should be included.
Impact
On a real project directory this inflates the listing noticeably — a repo root here returns 25 entries from ls -1 and 32 from rtk ls -1, the extras being ., .., .DS_Store, .claude, .git, .gitignore, .superpowers. Since rtk exists to reduce tokens sent to an LLM, -1 listings are currently larger than the native command they replace, and consumers that count entries will over-count.
Possibly related
This may be a regression from the fix for #803 (rtk ls -1 returned empty output), which this version does resolve — -1 no longer returns (empty). I have not read the implementation, so the connection is a guess rather than a finding.
Summary
In
rtk ls, the-aflag has no effect on which entries are listed, and-1— which should only control one-entry-per-line formatting — is what determines whether hidden entries appear. The result is that three of the four common flag combinations disagree with nativels.Environment
lsalias;LANGunset,LC_COLLATE=CReproduction
lsrtk lsvisible.txt.hiddenvisible.txt-1visible.txt....hiddenvisible.txt.,..and a dotfile-a....hiddenvisible.txt.hiddenvisible.txt.and..-1a....hiddenvisible.txt....hiddenvisible.txtDeterministic across repeated runs. Exit code is 0 in all cases.
Expected
rtk lsshould honour-afor hidden-entry inclusion, and-1should affect formatting only. Concretely: without-a, entries beginning with.should be omitted; with-a,.and..should be included.Impact
On a real project directory this inflates the listing noticeably — a repo root here returns 25 entries from
ls -1and 32 fromrtk ls -1, the extras being.,..,.DS_Store,.claude,.git,.gitignore,.superpowers. Since rtk exists to reduce tokens sent to an LLM,-1listings are currently larger than the native command they replace, and consumers that count entries will over-count.Possibly related
This may be a regression from the fix for #803 (
rtk ls -1returned empty output), which this version does resolve —-1no longer returns(empty). I have not read the implementation, so the connection is a guess rather than a finding.