There are two ways to open Emacs in the terminal.
emacsclient -nw (connects to an existing daemon) and
emacs -nw (creates a new instance of Emacs in the terminal). The background of the daemon terminal frame will be different – sometimes an ugly shade of your chosen theme’s highlight.
emacsclient -nw, right:
This occurs because the
solaire-mode plugin tries to use a slightly off-background color for your real, file-visiting buffers, but while this looks great in GUI Emacs…
It doesn’t in the terminal because terminals only support 256 colors (by default). There, a subtle shade is difficult to achieve, so Emacs approximates, and often does so poorly.
solaire-mode when you start tty Emacs (
emacs -nw), but cannot do this for daemon users; it cannot guess what kind of frame you’re will open, so it’s leave to users to disable it themselves.
Why is there no permanent solution?
Users can open graphical or terminal frames from a daemon session. It is impossible to guess which the user will use, primarily. Doom assumes GUI frames and leaves
solaire-mode on (leaving it to uses to disable it otherwise).
There is no such thing as frame-local themes or face customizations in Emacs, so
solaire-mode cannot apply itself on a per-frame basis.
:ui doom module does try to guess, but it appears to only work for some and not others, and will affect all open frames, graphical or otherwise.
What is the workaround?
There are two:
solaire-mode. If you intend to use Emacs primarily in the terminal.
(package! solaire-mode :disable t) to
- Restart Emacs.
- Adopt a terminal with 24-bit color support.
I want Emacs’ background to match my terminal
In addition to the workarounds above, the following snippet will make Emacs’ background “transparent”, therefore matching your terminal:
;; add to ~/.doom.d/config.el
'(default :background nil))
Check out “How to switch, customize, or write themes” for more on customizing your theme’s faces.