Add "Tc" capability to foot and foot-direct terminfo entries #615

Closed
opened 4 months ago by craigbarnes · 0 comments
Collaborator

The Tc terminfo capability is used by tmux to determine if 24-bit colors are supported by the outer terminal:

Tc      Indicate that the terminal supports the ‘direct colour’ RGB escape sequence (for example, \e[38;2;255;255;255m).

If supported, this is used for the initialize colour escape sequence (which may be enabled by adding the initc and ccc capabilities to the tmux terminfo(5) entry).

This is equivalent to the RGB terminfo(5) capability.

Even though the manual says it's "equivalent" to the RGB capability (in the context of tmux at least), I think the way it's used in practice makes it safe to enable in both the foot and foot-direct terminfo entries. As far as I can tell, there's only tmux making use of it at the moment and it doesn't seem to cause any problems; as can sometimes be the case when using RGB.

Setting Tc by default should make 24-bit colors "just work" in tmux, without the need to add overrides in .tmux.conf (see: #492, #215). It should also rule it out as a possible cause, when dealing with any future, tmux-related bug reports.

FWIW, kitty seems to set Tc by default too, despite not setting RGB or colors#0x1000000 or the longer forms of setaf/setab.

The [`Tc`](https://man.openbsd.org/OpenBSD-current/man1/tmux.1#Tc) terminfo capability is used by tmux to determine if 24-bit colors are supported by the outer terminal: > `Tc`      Indicate that the terminal supports the ‘direct colour’ RGB escape sequence (for example, `\e[38;2;255;255;255m`). > > If supported, this is used for the initialize colour escape sequence (which may be enabled by adding the `initc` and `ccc` capabilities to the tmux terminfo(5) entry). > > This is equivalent to the `RGB` terminfo(5) capability. Even though the manual says it's "equivalent" to the `RGB` capability (in the context of tmux at least), I think the way it's used in practice makes it safe to enable in both the `foot` and `foot-direct` terminfo entries. As far as I can tell, there's only tmux making use of it at the moment and it doesn't seem to cause any [problems](https://github.com/kovidgoyal/kitty/commit/18fe2e8dfa34038aabd5c3a2fdb3624e2b27932a#commitcomment-31373962); as can sometimes be the case when using `RGB`. Setting `Tc` by default should make 24-bit colors "just work" in tmux, without the need to add overrides in `.tmux.conf` (see: #492, #215). It should also rule it out as a possible cause, when dealing with any future, tmux-related bug reports. FWIW, kitty seems to [set](https://github.com/kovidgoyal/kitty/blob/21059402862ed29fc8a230aef9985313af820635/terminfo/kitty.terminfo#L3) `Tc` by default too, despite *not* setting `RGB` or `colors#0x1000000` or the longer forms of `setaf`/`setab`.
craigbarnes referenced this issue from a commit 4 months ago
craigbarnes closed this issue 4 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.