生成 terminfo

$ cat <<EOF > terminfo-24bits.src
# Use semicolon separators.
xterm-24bits|xterm with 24-bit direct color mode,
				use=xterm-256color,
				Tc,
				setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
				setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,]]
EOF

$ tic -x -o ~/.terminfo terminfo-24bits.src

通过 xterm-24bits 启动 Emacs

$ env TERM=xterm-24bits emacs

Emacs 通过 list-color-display 查看效果。