I'm typically running emacs -nw: problem is that Emacs overrides terminal (bash) color scheme and uses it's own default one which is in some cases unreadable.

I would like emacs to use default colors which are defined in my terminal "app". I recently updated to Ubuntu 16.04 and this is when this started happening.

Was looking, couldn't find an answer anywhere.

(setq frame-background-mode 'dark)

seems to fix readability problem, however it's not 100% what I would like

  • You could try conditionally setting your theme when (display-graphic-p) is t. – user12563 Jul 22 '18 at 9:26
  • Thanks for your answer, would you care to elaborate a bit more? – miro2 Jul 22 '18 at 11:02
  • Can you explain why it is not 100% what you want? Please specify just what you want, and say what is still missing. – Drew Jul 22 '18 at 16:17
  • 1
    If that's the case, you probably want to disable font-lock-mode. – user12563 Jul 22 '18 at 18:35
  • 1
    Another approach could be this which would base your emacs theme on the X settings. – InHarmsWay Aug 23 '18 at 11:51

A simple way to accomplish this is to set the theme only when you start Emacs with a graphical frame. This isn't the most robust solution, as it won't work with Emacs ran as a daemon, which would cause trouble when you have both text and graphical frames at the same time, and if you just start a daemon, it doesn't claim it's graphical.

Anyway, you can try adding something like this to your init file:

(when (display-graphic-p)
  (load-theme 'my-theme t))

Where my-theme should be replaced with the name of a theme you want to use.

  • thanks for your answer, will try this and report back asap – miro2 Jul 22 '18 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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