相关的 patch/fork 早就有了,我试过几次都没成功(可能跟当时使用的终端和终端配置有关),于是放弃了治疗。
刚才看到这个回复:https://github.com/bbatsov/solarized-emacs/issues/18#issuecomment-294374266
here’s how i went around the problem. code supporting 24bit colors is already in emacs’ development version: e463e57 on osx this can easily be installed via the emacs-plus brew formula, using the --HEAD option.
this version of emacs requires a custom terminfo description xterm-24bit, which needs to be compiled manually:
$ cat terminfo-24bit.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, $ tic -x -o ~/.terminfo terminfo-24bit.src
this will also work for tmux, provided that true color is also setup tmux side. source: Re: Black and white emacs -nw (WAS: Re: [PATCH v3 0/4] Support 24-bit te more on how to setup tmux true color here.
TERM=xterm-24bits emacs -nw and the theme works flawlessly.
跟着试了一下,果然在终端下看到了平滑过度的灰色:
- macOS 10.11.6
- iTerm2 v3.0.15 + Solarized-dark