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

From: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
Date: Wed, 5 Oct 2016 09:19:19 -0300

$ echo '140,146p' | ed config.def.h
20475
/*
  * Colors used, when the specific fg == defaultfg. So in reverse mode this
  * will reverse too. Another logic would only make the simple feature too
  * complex.
  */
static unsigned int defaultitalic = 11;
static unsigned int defaultunderline = 7;

On 05/10/16 08:37, Ingo Krabbe wrote:
> Hey suckless developers,
>
> first let me thank you for your great work. dwm and st have become my main linux tools as a base to control nearly everything, as long I don't switch to my plan9 virtual machine and do things in rc terminals or acme windows.
>
> But today a bug in st burned some hours. So let me tell you the short story: The main systems I use have a plain gentoo installed, because that's a good way to keep a system up-to-date, once you got familiar with gentoo at all. 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.
>
> Gentoo has a little trick 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='' # BLINK [5;31m
> LESS_TERMCAP_md='' # BOLD [1;34m
> LESS_TERMCAP_me=''
> LESS_TERMCAP_us='' # UNDERLINE [4;36m
> LESS_TERMCAP_ue=''
> LESS_TERMCAP_so='' # ITALIC [3;90m
> LESS_TERMCAP_se=''
> #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.
>
> 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
>



-- lv.
Received on Wed Oct 05 2016 - 14:19:19 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 05 2016 - 14:24:12 CEST