Skip to content

[ls] 列填充偏差:-s 大小列不右对齐;-x/--format=across 列距多 1 空格、窄宽度少一列 #1641

Closed

Description

@caomengxuan666

现象

  1. ls -s/--block-size 的块数列未按最大值右对齐:GNU 在存在 20 huge.bin 时单位数输出 4 a.txt,WinuxCmd 输出 4 a.txt。
  2. ls -x/--format=across 列间填充比 GNU 多 1 空格;窄宽度下少排一列(-w 20:GNU 2 列,WinuxCmd 1 列)。
  • WinuxCmd:WinuxCmd 1.2.1(基线 b781ff3,Release 构建)

  • GNU oracle:coreutils 9.4(WSL2),LC_ALL=C、TZ=UTC

  • 契约锚点:DOCS/oracle-audit/ls.md 行 L29 / L37

复现

$d = "$env:TEMP\ls-pad"; Remove-Item -Recurse -Force $d -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $d | Out-Null
"aaa" | Set-Content "$d\a.txt"; "bbbbb" | Set-Content "$d\b.txt"
$f=[IO.File]::Create("$d\huge.bin"); $f.SetLength(20000); $f.Close()
& "...\ls.exe" -s -1 $d
& "...\ls.exe" -x -w 20 $d

GNU 9.4(expected,cat -A):

 4 a.txt
 4 b.txt
20 huge.bin
a.txt  b.txt
huge.bin

WinuxCmd 1.2.1(actual):

4 a.txt
4 b.txt
20 huge.bin
a.txt
b.txt
huge.bin

Activity

  1. added
    compat-gap
    on Nov 14, 2026
  2. caomengxuan666 commented on Nov 14, 2026

    @caomengxuan666
    MemberAuthor

    intake 定序:ls 面同文件串行——本单待 #1639 合入后派修(队长队列,先派 #1639)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

compat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions