0

I am using Mac OS X Monterey. I have the following settings in .emacs

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") (load-theme 'liso t)

but I noticed that these settings are not valid for emacs -nw.

How can I find what theme is used for emacs -nw?

2 Answers 2

0

It’s not invalid, it’s just that emacs -nw tells Emacs not to open a GUI window. It stays inside the terminal instead. Your terminal only allows a limited color palette, usually just 16 colors, but sometimes 256. Of course the colors from your theme are going to be replaced with colors from the palette; there’s nothing else Emacs can do.

1
  • Thank you - I added to .bashrc a line with "export TERM=xterm-256color"; the colors are close between emacs and emacs -nw, but not identical. Anyhow, it is much better and I can read the text.
    – PaulTX
    Commented Feb 8, 2023 at 2:16
0

From the comments it sounds like you're comparing with 24-bit "true" colour in the GUI.

Emacs can use 24-bit colour in a terminal -- provided that (a) the terminal actually supports it, and (b) that ability has been identified to Emacs.

See: https://www.gnu.org/software/emacs/manual/html_node/efaq/Colors-on-a-TTY.html
or: C-hig (efaq)Colors on a TTY

Ideally there's a TERM value which correctly identifies the terminal you're using and its colour capabilities, but also note that "If Terminfo database is not available, but 24-bit direct color mode is supported, it can still be enabled by defining the environment variable COLORTERM to truecolor."

If the terminal emulator you're currently using doesn't support 24-bit colour, there will be others which do.


Failing any of that, note also that faces can be customized differently for different terminals. If you go to the customize UI for a face and go to "State -> For All Kinds of Displays" and then "INS -> Display -> specific display" you'll see that you have very detailed control over how Emacs displays faces on various different terminal types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.