如何设置 vterm 的 face,我这浪费了一个晚上

我这里需要设置 vterm-color-black 这个 face ,因为不够黑,zsh的提示代码不能很好的展示

after-init 添加 hook 试过了,重启 emacs 后还是 一样

(add-hook 'after-init-hook 
	  (lambda () 
	    (progn 
	      (set-face-attribute 'vterm-color-black :foreground "black" :background "black")
	      )))

另外尝试过更改主题代码,我用的 doom-one-light,在 def-doom-theme中添加

  (
   (vterm-color-black   :background base8   :foreground base8)
   (vterm-color-white   :background base0   :foreground base0)
)

重启加载该主题后,查看 list-face-display 中的 vterm-color-black ,还是一个鸟样,都是 def-doom-theme 中的 base0 颜色

看样子是继承了term-color-black的颜色。

方法一:

把 inherit 去掉:

(set-face-attribute 'vterm-color-black nil
		    :inherit 'unspecified
		    :background "black")

(custom-set-faces '(vterm-color-black ((t (:inherit unspecified :background "black")))))

方法二:

把上述 vterm 的 v 去掉,即直接对 term-color-black 动手。

卧槽,我才发现 set-face-attribute 那里我少写了一个 nil

成年人的崩溃往往就在一瞬间 :rofl: