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


Groups > linux.debian.user > #256796

Re: vtty & X terminal color scourge

From davidson <davidson@freevolt.org>
Newsgroups linux.debian.user
Subject Re: vtty & X terminal color scourge
Date 2023-04-05 21:20 +0200
Message-ID <GhgPL-kp-1@gated-at.bofh.it> (permalink)
References <Gh1e1-hqDN-1@gated-at.bofh.it> <Gh1nH-hqHb-1@gated-at.bofh.it> <Gh5Ul-hukd-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 5 Apr 2023 davidson wrote:
> On Tue, 4 Apr 2023 Greg Wooledge 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.
> [trimmed interesting stuff about dircolors]
>
> My reading of the OP is that his ls output is not colorised, and he
> probably does *not* want to hand-roll some custom color semantics. He
> just wants to enable the behavior he remembers.

TLDR: I ate some dog food and it tasted to me like Felix probably does
need to do some hand-rolling after all.

So I open an xterm and enter

  $ setterm --background blue --foreground white --bold on --store
  setterm: terminal xterm does not support --store

and hit Ctrl-L. Blue sky, white fluffy characters.

With a foreboding sense of doom, I then cd to a directory with a
broken link and try

  $ ls --color=auto

and get .... eww.

The attributes are reset. Everywhere that gets redrawn is reset to my
defaults (steelblue1 on black, and no bold). And with a second Ctrl-L
the darkness is complete.

Then I re-read the man page for setterm

  --store
        Stores the terminal's current rendering options (foreground and
        background colors) as the values to be used at
        reset-to-default.  Virtual consoles only.
                           ^^^^^^^^^^^^^^^^^^^^^

It does indeed work fine in a VT. But the default foreground color
(bold blue?) for directories is unfortunate, given Felix's background
color. (Adding -p to ls helps a little...not enough)

If I launch an xterm with

   $ lxterm -bg blue -fg white

then there's no need to use "setterm --store" to fix the rendering
defaults for background/foreground. White-on-blue is then the default
and the "ls --color=auto" test succeeds, modulo the unfortunate
default directory foreground color.

As for setterm's "--bold on", I don't know whether there are
equivalent xterm switches.

-- 
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin

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