Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Emacs terminal colors the same as Emacs GUI colors?

People also ask

How do I change the color of my emacs theme?

You can enable a specific Custom theme in the current Emacs session by typing M-x load-theme . This prompts for a theme name, loads the theme from the theme file, and enables it. If a theme file has been loaded before, you can enable the theme without loading its file by typing M-x enable-theme .

How do I add color scheme to gnome terminal?

In GNOME terminal, you reach it through the Application menu along the top of the screen or in the right corner of the window. In Preferences, click the plus symbol (+) next to Profiles to create a new theme profile. In your new profile, click the Colors tab.

How do I make a colorful terminal in Linux?

You can add color to your Linux terminal using special ANSI encoding settings, either dynamically in a terminal command or in configuration files, or you can use ready-made themes in your terminal emulator. Either way, the nostalgic green or amber text on a black screen is wholly optional.


You don't have to be stuck to your terminal's default 16 (or fewer) colours. Modern terminals will support 256 colours (which will get you pretty close to your GUI look).

Unfortunately, getting your terminal to support 256 colours is the tricky part, and varies from term to term. This page helped me out a lot (but it is out of date; I've definitely gotten 256 colours working in gnome-terminal and xfce4-terminal; but you may have to build them from source.)

Once you've got your terminal happily using 256 colours, the magic invocation is setting your terminal type to "xterm-256color" before you invoke emacs, e.g.:

env TERM=xterm-256color emacs -nw

Or, you can set TERM in your .bashrc file:

export TERM=xterm-256color

You can check if it's worked in emacs by doing M-x list-colors-display, which will show you either 16, or all 256 glorious colours.

If it works, then look at color-theme like someone else suggested.

(You'll probably get frustrated at some point; god knows I do every time I try to do something similar. But stick with it; it's worth it.)


I'm not sure if it is possible, as the GUI may have more capabilities than the terminal (yes, I've seen GUI terminals with only 16 colors very recently). It may depend on how the terminal is set. At any rate I would play with Color Theme.

Anyway, why are you using Emacs in both, the terminal and the GUI? Generally people find one or the other appealing and use only that one. If you are using Emacs remotely, maybe you want to run it locally and use Tramp to open files remotely, or as root.