Skip to content

ls: Tab produces \t instead of TAB and the output is not sorted correctly. #5490

@allaboutevemirolive

Description

@allaboutevemirolive

Steps to reproduce:

touch "a........a"
touch "a....	a"
touch "a		.....a"
touch "aaaaaaaaaaa"
touch "aaaaaaaaaaaa	a"
touch "aaaaaaaaaaaaaaaaa"
touch "a	·····b"
touch "a├─┤·····b"
touch "test....test"
touch "test			test"

ls -Cw18 | batcat -A

./coreutils ls -Cw18 | batcat -A

Sample output:

$ ls -Cw18 | batcat -A
───────┬────────────────────────────────────────────────────────────────────────────────
       │ STDIN
───────┼────────────────────────────────────────────────────────────────────────────────
   1   │ a├──┤├──┤.....a␊
   2   │ a....├──┤a␊
   3   │ a........a␊
   4   │ aaaaaaaaaaa␊
   5   │ aaaaaaaaaaaa├──┤a␊
   6   │ aaaaaaaaaaaaaaaaa␊
   7   │ a├──┤\u{b7}\u{b7}\u{b7}\u{b7}\u{b7}b␊
   8   │ a\u{251c}\u{2500}\u{2524}\u{b7}\u{b7}\u{b7}\u{b7}\u{b7}b␊
   9   │ coreutils␊
  10   │ test├──┤├──┤├──┤test␊
  11   │ test....test␊
───────┴────────────────────────────────────────────────────────────────────────────────
$ ./coreutils ls -Cw18 | batcat -A
───────┬────────────────────────────────────────────────────────────────────────────────
       │ STDIN
───────┼────────────────────────────────────────────────────────────────────────────────
   1   │ 'a'$'\t\t''.....a'␊
   2   │ 'a'$'\t''\u{b7}\u{b7}\u{b7}\u{b7}\u{b7}b'␊
   3   │ 'a....'$'\t''a'␊
   4   │ a........a␊
   5   │ aaaaaaaaaaa␊
   6   │ 'aaaaaaaaaaaa'$'\t''a'␊
   7   │ aaaaaaaaaaaaaaaaa␊
   8   │ a\u{251c}\u{2500}\u{2524}\u{b7}\u{b7}\u{b7}\u{b7}\u{b7}b␊
   9   │ coreutils␊
  10   │ 'test'$'\t\t\t''test'␊
  11   │ test....test␊
───────┴────────────────────────────────────────────────────────────────────────────────

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions