bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting `colors` property on *other* terminals


From: Bruno Haible
Subject: Re: Detecting `colors` property on *other* terminals
Date: Fri, 03 Jan 2025 02:15:14 +0100

Hi,

Christian Parpart wrote:
> I'd prefer the whole `if`-statement in
> 
>     libtextstyle/gnulib-local/lib/term-ostream.oo.c around line 2676

The reason for this 'if' statement in

https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=libtextstyle/gnulib-local/lib/term-ostream.oo.c;h=94f01e09a46e3487448ed8df0b6e9784c494883e;hb=HEAD#l2674

is that some terminal emulators can be used in 8-bit colors or 24-bit colors
modes, and typically the TERM environment variable is the only way to
distinguish the two (especially on systems where the terminfo or termcap entries
are outdated).

> I was just trying out `msgcat --color=test` on the terminal I am developing
> since quite some years (Contour). I first realized that the hue/saturation
> section looks quite odd. I checked out your gettext source code and figured
> out that I need to bump up the `colors` terminfo entry from 256 to 32767.

According to the published terminfo descriptions of 'contour'
https://invisible-island.net/ncurses/terminfo.src.html#toc-_Contour
the way to fix this issue is NOT to bump the 'colors value in the
terminfo entry for 'contour', but instead to set TERM=contour-direct.

And when TERM is set to 'contour-direct', the 'if' statement mentioned
above will see (true).

> there are plenty of other new terminal
> emulators rising in past years as well (Ghostty, WezTerm, foot, ...).

Feedback from someone who has tried 'foot' would be welcome.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]