Description
In tools/ls/ls.go, writePlain uses hardcoded format widths (%-10s, %8s). For entries with long owner names, long filenames, or large file sizes, columns fall out of alignment.
Steps to Reproduce
- Create a directory with files owned by a user with a long username
- Run
aict ls . --plain
- Observe misaligned columns
Expected Behavior
Column widths should be computed dynamically based on the longest value per column, matching GNU ls -l behavior.
Implementation Approach
- First pass: collect all entries and compute
maxOwnerLen, maxGroupLen, maxSizeLen
- Second pass: format output using computed widths
Actual Behavior
Fixed-width columns cause visual misalignment when any value exceeds the hardcoded width.
Related
tools/ls/ls.go writePlain function
Description
In
tools/ls/ls.go,writePlainuses hardcoded format widths (%-10s,%8s). For entries with long owner names, long filenames, or large file sizes, columns fall out of alignment.Steps to Reproduce
aict ls . --plainExpected Behavior
Column widths should be computed dynamically based on the longest value per column, matching GNU
ls -lbehavior.Implementation Approach
maxOwnerLen,maxGroupLen,maxSizeLenActual Behavior
Fixed-width columns cause visual misalignment when any value exceeds the hardcoded width.
Related
tools/ls/ls.gowritePlainfunction