public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: util-linux@vger.kernel.org
Cc: "Sami Kerola" <kerolasa@iki.fi>, "Pádraig Brady" <P@draigBrady.com>
Subject: terminal-colors.d and termname
Date: Tue, 29 Apr 2014 12:46:40 +0200	[thread overview]
Message-ID: <20140429104640.GC24681@x2.net.home> (raw)


 Hi,

 I'd like to support terminal names ($TERM) in terminal-colors.d,
 because the current implementation does not care about terminal
 types, so you can disable/enable the colors only globally for all
 terminals. That's stupid, because xterm-256color is not the 
 same thing as vt100, etc.

 possible ways:

 1) add terminal name to the file names, for example

    touch terminal-colors.d/dmesg@vt100.disable

 The disadvantage is that there is huge number of terminals and 
 this concept does not allow to use patterns (e.g. fnmatch() patterns 
 like xterm-*). But I think the patterns are unnecessary, because people
 usually use very small set of terminals (serial line, ssh, xterm), so 
 force users to use whole terminal names is no so big problem.

 The advantage is the we can use this concept for color schemes and
 support symlinks to reuse the same scheme for a different terminals.
 The nice things is also that one readdir() is enough to get whole
 configuration.

   echo "error red standard" > dmesg@xterm.scheme
   ln -s dmesg@xterm.scheme dmesg@linux.scheme

 2) use sub-directory

    /etc/terminal-colors/<termname>/dmesg.disable

 but it's less readable (you need "ls -R" or "find") and use symlinks
 will be nightmare.


 3) store the terminal names (or patterns) to the files

    echo "TERM vt10*" >> dmesg.disable

 The same way uses coreutils DIR_COLORS. This concept means that we
 have to always parse the files and you cannot easily create two
 independent color schemes for the same util as there is only one
 'dmesg.scheme', so we will need more advanced file format with
 multiple sections, etc.

 4) ?


 I prefer 1) because it's KISS concept and we have a chance to see
 this way supported by another projects too.

    Karel

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

             reply	other threads:[~2014-04-29 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 10:46 Karel Zak [this message]
2014-04-29 16:52 ` terminal-colors.d and termname Sami Kerola
2014-04-30  6:46   ` Karel Zak

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=20140429104640.GC24681@x2.net.home \
    --to=kzak@redhat.com \
    --cc=P@draigBrady.com \
    --cc=kerolasa@iki.fi \
    --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