public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: "Mantas Mikulėnas" <grawity@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: terminal-colors.d changes
Date: Wed, 14 May 2014 10:19:46 +0200	[thread overview]
Message-ID: <20140514081946.GB26357@x2.net.home> (raw)
In-Reply-To: <lktnib$mk7$1@ger.gmane.org>

On Tue, May 13, 2014 at 09:16:40PM +0300, Mantas Mikulėnas wrote:
> On 2014-05-13 14:38, Karel Zak wrote:
> >   * "scheme" files to customize colors are supported now, for example
> > 
> >        echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme
> > 
> >     sets red background color for alert messages.
> >     
> >     The scheme files supports color names (e.g. "red"), ANSI color
> >     sequences (e.g. 37;41) and escape sequences (e.g. \a for bell).
> 
> Does it support multiple escape sequences?
> 
> The 16/256/RGB-color sequence is a bit _odd_ in that it consists of
> three parameters (e.g. \e[38;5;72m for color72) and generally cannot be
> mixed with other sequences. (Some terminals allow this, others forbid,
> particularly mosh [1].)

Yes, for example

   echo 'warn 38;5;72' >> /etc/terminal-colors.d/dmesg.scheme

works. The \e[ m is unnecessary (we follow coreutils dir colors
semantic).

> I guess right now 'alert 38;5;16m\e[48;5;202' would work, but it just
> doesn't feel right.

  alert 38;5;16m\e[48;5;202

works, but in this case more consistent and readable notation is probably

  alert \e[38;5;16m\e[48;5;202m  

that works too. 

(The result is orange background and black foreground, right? :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

      reply	other threads:[~2014-05-14  8:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 11:38 terminal-colors.d changes Karel Zak
2014-05-13 18:16 ` Mantas Mikulėnas
2014-05-14  8:19   ` Karel Zak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140514081946.GB26357@x2.net.home \
    --to=kzak@redhat.com \
    --cc=grawity@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox