Re: ls --color

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05Dec2022 14:22, Patrick Dupre <pdupre@xxxxxxx> wrote:
If I do

ls --color=auto -lt "$@" --color | more

BTW, what's in "$@" ? For example.

and that the last displayed color is red,
this red color is used for all my following ls

That's odd, and does not seem like correct behaviour. Does it do it if you do not pipe through "more"?

I can't reproduce this (Ubuntu 21.04 here, not Fedora).

How can I reset the color setting?

The --color is supposed to only control ls's decisions about how to colour the output. Does making the trailing --color either --color=never change anything?

Have you tried something like:

    ls --color=auto -lt a b --color | od -c

i.e. exactly 2 filenames, the first or second or which will be "red", and examined the ANSI colour sequences in the (now small) output?

There _should_ be a "default colour" as the final colour sequence to reset the output to the terminal's default colours. That should be "ESC [ 0 m". Example:

    [~]borg*> ls -ld --color=always . | od -c
    0000000   d   r   w   x   r   -   s   r   -   x       5   5       c   a
    0000020   m   e   r   o   n       c   a   m   e   r   o   n       8   1
    0000040   9   2       D   e   c           6       0   7   :   4   2
    0000060 033   [   0   m 033   [   0   1   ;   3   4   m   . 033   [   0
    0000100   m  \n
    0000102

See the "033 [ 0 m" sequence? That is the one which restore's the terminal's colour output the the default.

Cheers,
Cameron Simpson <cs@xxxxxxxxxx>


Thank
===========================================================================
Patrick DUPRÉ                                 | | email: pdupre@xxxxxxx
Laboratoire interdisciplinaire Carnot de Bourgogne
9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE
Tel: +33 (0)380395988                    | | Room# D114A
===========================================================================
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

--
Cameron Simpson <cs@xxxxxxxxxx> (formerly cs@xxxxxxxxxx)

They're not hiding, they're just selective.
- overhead by WIRED at the Intelligent Printing conference Oct2006
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux