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. – DoMiNeLa10 Jul 22 at 9:26
  • Thanks for your answer, would you care to elaborate a bit more? – miro2 Jul 22 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 at 16:17
  • It's not because emacs still overrides my terminal colors: ie if I set all my terminal font colors to red, I want emacs to display only red letters – miro2 Jul 22 at 18:07
  • If that's the case, you probably want to disable font-lock-mode. – DoMiNeLa10 Jul 22 at 18:35

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 at 18:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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