How can I adjust the term
face in the new Emacs to get the same control that was possible with ansi-term-color-vector
?
One of the new features in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term
buffers, i.e.:
The variables
term-default-fg-color
andterm-default-bg-color
are now deprecated in favor of the customizable faceterm
.You can customize how to display ANSI terminal colors and styles by customizing the corresponding
term-color-COLOR
,term-color-underline
andterm-color-bold
faces.
Mickey from Mastering Emacs comments the following:
If, like me, you customized
ansi-color-names-vector
to change the default term colours I suggest you switch to using the faces now. The good news here is you can, should desire to, change more than just the colours for each ANSI Color: there’s nothing stopping you from forcing a different font for certain colours
Like Mickey, I was also using ansi-color-names-vector
to make sure that the color of my term
buffers looked well on dark themes (e.g. tango-dark
)
(setq ansi-term-color-vector [unspecified “black” “red3” “lime green” “yellow3” “DeepSkyBlue?3” “magenta3” “cyan3” “white”])
But this now results in an error:
"error in process filter: Invalid face; unspecified"
In an attempt to use the new face term
, when I go to M-x describe-face term
, I see the following:
[] Font Family
[] Font Foundry
[] Width
[] Height
[] Weight
[] Slant
[] Underline
[] Overline
[] Strike-through
[] Box around text
[] Inverse-video
[] Foreground
[] Background
[] Stipple
[x] Inherit
But how do I adjust these settings to get the same effect I achieved using ansi-term-color-vector
?
Update
I am still unable to fix the colors. Here is the menu that I get for M-x customize-theme tango-dark
:
And here is an example of one of the colors/faces in a terminal that are hard to see:
I would suggest M-x
customize-group
RETterm
RETas the easiest entry point to customizing those colours.
This worked for me in Emacs 24.3.1 to set the colors of term and ansi-term. Just change the colors to your preferred values (with the background adjusted accordingly).
In Emacs 24.3 you'll need to adjust the following faces:
This code is from the latest version of Zenburn. Personally I feel that the new way of customising the faces is an improvement over the use of the obscure vector.