From 3e74482d6c709b09477fdab3a0be6ba678c4accb Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 29 Jun 2021 08:47:46 +0100 Subject: [PATCH] terminfo: add Tc, setrgbf and setrgbb capabilities These extensions are used by tmux and neovim, in order to make use of 24-bit colors without facing the problems that plague the `RGB` capability. This should allow 24-bit colors to work "out of the box" in tmux, without the usual workaround of adding: set-option -ga terminal-overrides ",foot*:Tc" ...to ~/.tmux.conf. See also: * https://github.com/kovidgoyal/kitty/commit/18fe2e8dfa34038aabd5c3a2fdb3624e2b27932a#commitcomment-31373962 * https://github.com/neovim/neovim/blob/f83c25942dd8b94ad5218ce78b9e6fb86d2f0358/runtime/doc/term.txt#L123-L139 * https://github.com/tmux/tmux/blob/b1a8c0fe022e99cffb0fb4f321740464f35bc6b9/CHANGES#L988-L989 Closes #615 --- CHANGELOG.md | 4 ++++ foot.info | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e6b7a73..a44d8105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,10 @@ ### Added * `--log-level=none` command-line option. +* `Tc`, `setrgbf` and `setrgbb` capabilities in `foot` and `foot-direct` + terminfo entries. This should make 24-bit RGB colors work in tmux and + neovim, without the need for config hacks or detection heuristics + (https://codeberg.org/dnkl/foot/issues/615). ### Changed ### Deprecated diff --git a/foot.info b/foot.info index 41c23593..37932204 100644 --- a/foot.info +++ b/foot.info @@ -24,6 +24,7 @@ foot+base|foot base fragment, xenl, AX, XT, + Tc, cols#80, it#8, lines#24, @@ -255,6 +256,8 @@ foot+base|foot base fragment, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, + setrgbb=\E[48\:2\:\:%p1%d\:%p2%d\:%p3%dm, + setrgbf=\E[38\:2\:\:%p1%d\:%p2%d\:%p3%dm, sgr0=\E(B\E[m, sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, sitm=\E[3m,