Page MenuHomeFreeBSD

ls(1): correct mentioned colors
AbandonedPublic

Authored by gbe on Aug 5 2020, 5:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 12:27 PM
Unknown Object (File)
Feb 3 2024, 10:11 AM
Unknown Object (File)
Jan 4 2024, 11:29 AM
Unknown Object (File)
Dec 20 2023, 7:17 AM
Unknown Object (File)
Dec 9 2023, 11:59 PM
Unknown Object (File)
Nov 19 2023, 12:55 PM
Unknown Object (File)
Nov 17 2023, 6:10 AM
Unknown Object (File)
Nov 16 2023, 10:04 PM
Subscribers
None

Details

Reviewers
None
Group Reviewers
manpages
Summary

ls(1): correct mentioned colors

I am not sure that this change can go in like it is right now, especially when
renaming a color from "brown" to "yellow, usually shows up as brown".

But I put here for further discussion.

From the PR:
The ls man page describes the colors wrong. I checked ls's code, and indeed it
can and does use ANSI color, so the actual ANSI standard can be referenced for
color names and behavior:

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf

Especially since the man page also references ANSI in the LSCOLORS section.
Discovered this on 12.1-RELEASE-p3 but wrote and attached a patch for the ls.1
currently seen in the GitHub repository (presumably -current)

Important to note is that some terminals do not have separate colors for bold
and non-bold text. Some terminals do have separate colors, of course, but not all.

Semi-relatedly, and not dealt with in this patch or bug report:
LSCOLORS's format is deficient, anyway. Setting it to bC, Bc, or BC provides
the same output. The colors struct in ls's print.c has bold-status,
foreground color, and background color as three different items. The LSCOLORS
string should have them as three different characters too, rather than conflating
boldness with one of the colors.

Hence I think bc should be 0bc and Bc, bC, and BC should be 1bc

PR: 245270

Test Plan

mandoc output review and 'mandoc -Tlint checks'

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32775
Build 30209: arc lint + arc unit

Event Timeline

gbe requested review of this revision.Aug 5 2020, 5:41 PM
gbe created this revision.