-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Some applications, like Vim, allow you to force the output of 24-bit color regardless of what the terminal advertises. But other applications, like Emacs, rely on the terminal advertisement.
There is an unreleased Emacs patch to add support for COLORTERM, but in the meantime, as I understand it, the only way to get Emacs to output 24-bit color is through terminfo.
With TERM=tmux-256color, Emacs is limited to 256 colors. Setting TERM=xterm-direct inside tmux causes Emacs to output 24-bit color. However, the tmux FAQ recommends a tmux-specific TERM value, which currently means either tmux or tmux-256color.
Would you consider upstreaming a terminfo value of tmux-direct as well? Or do you consider tmux-256color with COLORTERM to be the way forward?
I'm not sure how you would want to define it, but the following works for me with Emacs:
$ cat tmux-direct
tmux-direct|tmux with direct-color indexing,
use=xterm+direct, use=tmux,
$ tic -x -o ~/.terminfo tmux-direct
$ infocmp -x tmux-256color tmux-direct
comparing tmux-256color to tmux-direct.
comparing booleans.
RGB: F:T.
comparing numbers.
colors: 256, 16777216.
comparing strings.
setab: '\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m', '\E[%?%p1%{8}%<%t4%p1%d%e48\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d%;m'.
setaf: '\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m', '\E[%?%p1%{8}%<%t3%p1%d%e38\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d%;m'.