Re: [dev] Good Morning, and a question about st (italic mode switches color).

From: Martin Kühne <>
Date: Wed, 5 Oct 2016 13:57:47 +0200


Try to keep things short.

> I'm not sure yet if OpenRC is really much better than systemd, though, so if I would need to choose today I might switch to a plain debian, that I often use on servers.

We don't need to discuss these things here [0].

> Gentoo has a little trick...

As a matter of fact, Gentoo ha(ck)s a few tricks to the system, which
brought a lot of confusion onto me as well. I don't approve of that
part of Gentoo in particular.
ls colors where green is not associated with an executable bit is
really confusing to work with.

> to display manual pages, using a `MANPAGER=/usr/bin/manpager` command, that is a simple command compiled from the attached manpager.c command, which does nothing more then the shell script
> LESS_TERMCAP_mb=' [5;31m' # BLINK [0m [5;31m
> LESS_TERMCAP_md=' [1;34m' # BOLD [0m [1;34m
> LESS_TERMCAP_me=' [0;0m'
> LESS_TERMCAP_us=' [4;36m' # UNDERLINE [0m [4;36m
> LESS_TERMCAP_ue=' [0;0m'
> LESS_TERMCAP_so=' [3;90m' # ITALIC [0m [3;90m
> LESS_TERMCAP_se=' [0;0m'
> #export LESS_TERMCAP_{mb,md,me,us,ue,so,se}
> exec less
> without the _so and _se lines. But I like this italic setup, so I added the standout mode.

So that's how gentoo gets these colorful manpages. I've been asking myself that.
Good to know Gentoo is really reliable by being unsurprising.

> To do such switches in a more readable, suckless way one should actually use tput, imho, to switch the modes and select the colors:
> ITALIC_BLACK=`tput sitm; tput setaf 0`
> That works with xterm, but with st it selects a yellow color, which is a bit disturbing, as I use a light background and I cannot read yellow. So the basic bug is, that "sitm" (start italic mode) also affects the color. Actually it only affects "setaf 0". Most other colors aren't affected, which you can quick check with:
> for i in `seq 0 255`
> do tput setaf $i
> tput sitm
> echo -n "Test it!"
> tput ritm
> echo "Test it!"
> done
> Maybe thats a problem of the terminfo file. I didn't checked that yet, but maybe someone else already had such a problem too, so I wanted to ask first if that is considered a bug and if someone might already have a handy solution to it. Actually "tput ncf" says "3", which means that the italic attribute cannot be used with colors. But that is a lie. I would say, the italic attribute can only be used with colors. Best Regards, Ingo

That the italic attribute sets the color itself for not being able to
make itself noticeable in any other way means it can't be used with a
color setting diverging from the color that is used to make it italic.


Received on Wed Oct 05 2016 - 13:57:47 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 05 2016 - 14:00:32 CEST