Skip to content

rtk ls: -a is ignored; -1 controls hidden-entry visibility instead #3608

Description

@abvblo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions