emacs ansi-term background color

2019-05-04 16:13发布

问题:

I'm having a problem changing the background color in ansi-term (and also term - but shell is fine). It displays colors fine from output but the background color of the out put is always white. Not the entire buffer, but just under actual characters that have been outputted. If I do something like

(add-hook 'ansi-term-mode-hook
    (lambda ()
        (set-background-color "purple")))

This changes the buffer's background color, but the output just overrides it with its own background color - white.

I've also tried to find the face that it is using so I can customize it by doing C-u C-x = to get the info on the face at the point -- which works for everything else and even points you where to change it which is nice... but in ansi term i get this

    character: m (109, #o155, #x6d)
preferred charset: ascii (ASCII (ISO646 IRV))
   code point: 0x6D
       syntax: w    which means: word
     category: .:Base, a:ASCII, l:Latin, r:Roman
  buffer code: #x6D
    file code: #x6D (encoded by coding system utf-8)
      display: by this font (glyph code)
xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x50)

Character code properties: customize what to show
  name: LATIN SMALL LETTER M
  general-category: Ll (Letter, Lowercase)

There are text properties here:
  face                 (:background "white" :foreground "black")

[back]

I don't know where this is getting set. face (:background "white" :foreground "black")

Also, I've used multiple themes that I know have the ansi-term-color-vector (zenburn, etc). I've gone through every sample in customize-face and its no where in there either.

Any thoughts on how to override/set this so it's just the transparent (or unset) background like everything else?

Thanks for any help.

回答1:

I'm not sure if I understand what's going on in your setup but you can try setting:

(setq term-default-bg-color "#211E1E")
(setq term-default-fg-color "#AAAAAA")

Try it from scratch buffer start a new term and check.