C.7 Window Color Options
You can use the following command-line options to specify the colors to use for various parts of the Emacs display. Colors may be specified using either color names or RGB triplets (see Colors).
β-fg color
ββ
β--foreground-color=color
ββ
Specify the foreground color, overriding the color specified by the default
face (see Faces).
β-bg color
ββ
β--background-color=color
ββ
Specify the background color, overriding the color specified by the default
face.
β-bd color
ββ
β--border-color=color
ββ
Specify the color of the border of the X window. This has no effect if Emacs is compiled with GTK+ support.
β-cr color
ββ
β--cursor-color=color
ββ
Specify the color of the Emacs cursor which indicates where point is.
β-ms color
ββ
β--mouse-color=color
ββ
Specify the color for the mouse cursor when the mouse is in the Emacs window.
β-r
ββ
β-rv
ββ
β--reverse-video
ββ
Reverse video: swap the foreground and background colors.
β--color=mode
ββ
Set the color support mode when Emacs is run on a text terminal. This option overrides the number of supported colors that the character terminal advertises in its termcap
or terminfo
database. The parameter mode
can be one of the following:
βnever
ββ
βno
ββ
Donβt use colors even if the terminalβs capabilities specify color support.
βdefault
ββ
βauto
ββ
Same as when --color
is not used at all: Emacs detects at startup whether the terminal supports colors, and if it does, turns on colored display.
βalways
ββ
βyes
ββ
βansi8
ββ
Turn on the color support unconditionally, and use color commands specified by the ANSI escape sequences for the 8 standard colors.
βnum
ββ
Use color mode for num
colors. If num
is -1, turn off color support (equivalent to βnever
β); if it is 0, use the default color support for this terminal (equivalent to βauto
β); otherwise use an appropriate standard mode for num
colors. Depending on your terminalβs capabilities, Emacs might be able to turn on a color mode for 8, 16, 88, or 256 as the value of num
. If there is no mode that supports num
colors, Emacs acts as if num
were 0, i.e., it uses the terminalβs default color support mode.
If mode
is omitted, it defaults to ansi8
.
For example, to use a coral mouse cursor and a slate blue text cursor, enter:
emacs -ms coral -cr 'slate blue' &
You can reverse the foreground and background colors through the β-rv
β option or with the X resource βreverseVideo
β.
The β-fg
β, β-bg
β, and β-rv
β options function on text terminals as well as on graphical displays.