[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question about setal in terminfo db
From: |
Robert Lange |
Subject: |
Question about setal in terminfo db |
Date: |
Sat, 19 Mar 2022 13:05:04 -0400 |
I have a concern about the terminfo definition for setal, particularly for
tmux, but also in the other places it appears.
The definition I'm looking at in tmux-direct is:
setal=\E[%?%p1%{8}%<%t5%p1%d%e58:2::%p1%{65536}%/%d:%p1
%{256}%/%{255}%&%d:%p1%{255}%&%d%;m
This is clearly patterned after the setaf and setab definitions for direct
addressed color, in which the parameter value less than 8 generates something
like '\E[31m' and anything greater than 8 generates an RGB value. However, for
setal, I don't think this makes sense, as SGR 50-57 don't refer to the primary
terminal colors, but to other (generally unimplemented) terminal features.
I *think* the definition for setal should be simply:
setal=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1
%{255}%&%dm
I've tested this on tmux 3.2a and it works. When I pass in a parameter less
than 8, the underline color becomes the corresponding primary terminal color,
so I assume that the underlying terminal (libvte 0.54.2 in my case) has some
built-in logic to handle colors #000000-#000007 specially. Specifying colors
greater than or equal to 8 work exactly as expected, using the RGB value. (I've
also double-checked this using a libvte 0.54.2-based terminal without tmux,
with the same results.)
I don't have a copy of mintty handy, so I can't yet verify how that handles
setal, but I'd be surprised if '\E[51m' is the correct code for red underline,
given that their own documentation says it's supposed to be an emoji style
selector.
(That leads me to another point, which is that vte (at least 0.54.2 and later)
supports setal, so I'd like to add that to vte-256color and vte-direct, but we
can handle that in a separate thread if preferable.)
--
Rob Lange
- Question about setal in terminfo db,
Robert Lange <=