Skip to content

Implement ls -T #3624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sylvestre opened this issue Jun 13, 2022 · 1 comment · Fixed by #7616
Closed

Implement ls -T #3624

sylvestre opened this issue Jun 13, 2022 · 1 comment · Fixed by #7616
Labels

Comments

@sylvestre
Copy link
Contributor

info ls returns:

    Assume that each tab stop is COLS columns wide. The default is 8. ls uses tabs where possible in the output, for efficiency. If COLS is zero, do not use tabs at all.

    Some terminal emulators might not properly align columns to the right of a TAB following a non-ASCII byte. You can avoid that issue by using the -T0 option or put TABSIZE=0 in your environment, to tell ls to align using spaces, not tabs.

Simple test (uncomment the first line to run GNU's):

export C=./target/debug/coreutils
touch a b
$C ls -w4 -x -T3 a b > out
printf '%s\n' 'a  b' > exp
diff -u exp out

Currently, the option isn't implemented at all
error: Found argument '-T' which wasn't expected, or isn't valid in this context

Maybe a good second bug :)

tested by GNU here:
https://github.com/coreutils/coreutils/blob/master/tests/ls/w-option.sh#L37=
To run it:

bash util/run-gnu-test.sh tests/ls/w-option.sh  
@tertsdiepraam
Copy link
Member

If I remember correctly, ls currently does not use tabs in its output (and the alignment is handled by an external library). So I think the only option that does not require a full rewrite of the alignment code is to silently ignore this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants