[Bug 284166] [patch] Mention that ls(1) colorized output doesn't support tabs.

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 19 Jan 2025 15:39:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284166

            Bug ID: 284166
           Summary: [patch] Mention that ls(1) colorized output doesn't
                    support tabs.
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Manual Pages
          Assignee: bugs@FreeBSD.org
          Reporter: artembunichev@zohomail.com
                CC: doc@FreeBSD.org

Created attachment 256809
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=256809&action=edit
Patch for ls(1) man page.

Comments in bin/ls.c tell us that color sequences and tabs can not be used
together:

  if (f_color) {
        /*
         * We can't put tabs and color sequences together:
         * column number will be incremented incorrectly
         * for "stty oxtabs" mode.
         */
        f_notabs = 1;
        ...
  }

This affects the ls(1) behaviour when it's set to use colorized output. As can
be traced throught the source code, in this case visual appearance of tab stops
will be achieved by using whitespaces instead of tab characters (from print.c,
`printcol'):

  (void)putchar(f_notabs ? ' ' : '\t');

I suppose, it is worth to be mentioned in the manual page.

An appropriate patch is sent.

-- 
You are receiving this mail because:
You are on the CC list for the bug.