Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #256765

Re: vtty & X terminal color scourge

From David <bouncingcats@gmail.com>
Newsgroups linux.debian.user
Subject Re: vtty & X terminal color scourge
Date 2023-04-05 06:50 +0200
Message-ID <Gh3fP-hsCg-1@gated-at.bofh.it> (permalink)
References <Gh1e1-hqDN-1@gated-at.bofh.it> <Gh1nH-hqHb-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 5 Apr 2023 at 02:47, Greg Wooledge <greg@wooledge.org> wrote:
> On Tue, Apr 04, 2023 at 10:33:26PM -0400, Felix Miata wrote:

> > What bothers me more than anything is that dead symlinks haven't been red, or
> > anything else to distinguish them, in a long time.

> So... you're talking about the colors used by "ls", yes?
>
> If you don't want ls colors at all, you can use "ls --color=never".
> You can set that up as an alias/function.
>
> If you DO want colors, just not the ones you're currently getting, then
> you need to look at the LS_COLORS environment variable.
>
> According to ls(1), you're supposed to use dircolors(1) to generate
> this variable.  According to dircolors(1), you're supposed to run
> "dircolors --print-database" and read its output to learn how to set
> it up.

According to adduser(1):
  adduser will copy files from SKEL into the home directory

According to adduser.conf(5):
  SKEL is the directory from which skeletal user configuration files are copied.
  Defaults to /etc/skel

/etc/skel/.bashrc contains:
  # enable color support of ls and also add handy aliases
  if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" ||
eval "$(dircolors -b)"

The output of 'dircolors -b' looks like:
  LS_COLORS='<preconfigured_values>'; export LS_COLORS

The above is how Debian sets up the default value of LS_COLORS.

The values in use, if any, can be seen by
  echo $LS_COLORS

Personally I dislike the preconfigured values because they try
to color the output according to BOTH the type of file AND the
filename suffix, which creates a mess. Because the coloring
depends on whether or not the filename is matched.

I create a simpler ~/.dircolors which detects only the type of the file,
and use the above method to control the colors shown by 'ls'. I find it is
very useful for recognising hardlinks as well as good or bad symlinks
in the output of 'ls' command. It's not hard and gives a useful result.

I also configure 'mc' to use the same colors.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

vtty & X terminal color scourge Felix Miata <mrmazda@earthlink.net> - 2023-04-05 04:40 +0200
  Re: vtty & X terminal color scourge Greg Wooledge <greg@wooledge.org> - 2023-04-05 04:50 +0200
    Re: vtty & X terminal color scourge David <bouncingcats@gmail.com> - 2023-04-05 06:50 +0200
    Re: vtty & X terminal color scourge davidson <davidson@freevolt.org> - 2023-04-05 09:40 +0200
      Re: vtty & X terminal color scourge davidson <davidson@freevolt.org> - 2023-04-05 09:50 +0200
      Re: vtty & X terminal color scourge davidson <davidson@freevolt.org> - 2023-04-05 21:20 +0200
  Re: vtty & X terminal color scourge rhkramer@gmail.com - 2023-04-05 21:50 +0200
  Re: vtty & X terminal color scourge Dan Ritter <dsr@randomstring.org> - 2023-04-06 01:00 +0200

csiph-web