When I run emacs in a terminal (using the -nw option) my theme is broken and some key-bindings don't work.

So, I need to disable the theme and some keybindings when running in a tty.

Is there a way to do that?


You can use display-graphic-p to determine if you are running in a terminal or a windowing system.

For example, you could do your setup so that you only add those keybindings and theme if you know you're on a window system.

(when (display-graphic-p) 
    ;; Do any keybindings and theme setup here

You can also do the reverse, and turn off your keybindings and theme.

(unless (display-graphic-p) 
    ;; Remove any keybindings and theme setup here

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.