Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: "Samuel Thibault" <samuel.thibault@ens-lyon.org>,
	"Pádraig Brady" <P@draigbrady.com>,
	kerolasa@gmail.com, "Dale R. Worley" <worley@alum.mit.edu>,
	mrmazda@earthlink.net, util-linux <util-linux@vger.kernel.org>
Subject: Re: tty[1-6]: colors a negative accessibility/usability trend
Date: Mon, 2 Mar 2015 12:03:09 +0100	[thread overview]
Message-ID: <20150302110309.GJ8046@ws.net.home> (raw)
In-Reply-To: <20150302093146.GV3404@type.bordeaux.inria.fr>

On Mon, Mar 02, 2015 at 10:31:46AM +0100, Samuel Thibault wrote:
> Karel Zak, le Mon 02 Mar 2015 09:59:29 +0100, a écrit :
> > On Sun, Mar 01, 2015 at 01:32:01PM +0000, Pádraig Brady wrote:
> > > and I've not heard specific complaints about it.
> > > What terminals are not catered for here?
> > 
> > I don't know, my plan is to do some research to better understand what
> > Samuel is talking about.
> 
> Mmm, I thought it was well-known, but apparently not :/
> 
> I mean using this (see terminfo(5) for the details):
> 
> #include <term.h>
> #include <stdio.h>
> #include <unistd.h>
> 
> int main(void) {
>   int my_bg_color = 0;
>   int my_fg_color = 4;
> 
>   setupterm(NULL, STDOUT_FILENO, NULL);
>   tputs(enter_bold_mode, 1, putchar);
>   tputs(enter_italics_mode, 1, putchar);
>   tputs(enter_underline_mode, 1, putchar);
>   tputs(enter_blink_mode, 1, putchar);
>   tputs(enter_reverse_mode, 1, putchar);
>   tputs(tparm(set_a_foreground, my_fg_color), 1, putchar);
>   tputs(tparm(set_a_background, my_bg_color), 1, putchar);
>   printf("Hello, world!\n");
>   tputs(exit_attribute_mode, 1, putchar);
>   return 0;
> }
> 
> On terminals which support it, you can even get rgb colors by using
> initialize_color or initialize_pair. If you want a more complete
> example, see lstopo-text.c inside the hwloc package, we include ncurses,
> but we don't actually need it for this kind of code. 

This is misunderstanding, I know about tputs :)

The question is how often the harcoded sequences are problem, which
terminals? how often people use it? Would be enough to detect these
terminals and use things without colors there?

    Karel

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

  reply	other threads:[~2015-03-02 11:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  9:45 tty[1-6]: colors a negative accessibility/usability trend Felix Miata
2015-02-12 11:04 ` Pádraig Brady
2015-02-13  3:21   ` Dale R. Worley
2015-02-13  9:21     ` Karel Zak
2015-02-13 10:33       ` Sami Kerola
2015-02-13 11:25         ` Karel Zak
2015-02-15 11:12           ` Mike Frysinger
2015-02-16  9:10             ` Karel Zak
2015-02-16  9:35               ` Mike Frysinger
2015-02-16  9:47                 ` Karel Zak
2015-02-16 10:32                   ` Samuel Thibault
2015-02-16 13:49                     ` Karel Zak
2015-02-27 13:48                     ` Karel Zak
2015-03-01 13:32                       ` Pádraig Brady
2015-03-01 15:14                         ` Peter Cordes
2015-03-02  8:59                         ` Karel Zak
2015-03-02  9:31                           ` Samuel Thibault
2015-03-02 11:03                             ` Karel Zak [this message]
2015-02-15 17:38         ` Dale R. Worley
2015-02-16  9:18           ` Karel Zak
2015-02-13 17:55       ` Bruce Dubbs
2015-02-12 13:21 ` Karel Zak
2015-02-12 13:56   ` Samuel Thibault
2015-02-12 14:38     ` Karel Zak
2015-02-12 15:25     ` Edward d'Auvergne

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=20150302110309.GJ8046@ws.net.home \
    --to=kzak@redhat.com \
    --cc=P@draigbrady.com \
    --cc=kerolasa@gmail.com \
    --cc=mrmazda@earthlink.net \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=util-linux@vger.kernel.org \
    --cc=worley@alum.mit.edu \
    /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