我该如何调整 term
面对新的 Emacs 以获得与 ansi-term-color-vector
相同的控制?
new features其中之一在 Emacs 24.3 中似乎是修改了机制来控制 term
的脸缓冲区,即:
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
和米奇一样,我也在用
ansi-color-names-vector
确保我的 term
的颜色缓冲区在深色主题上看起来很好(例如 tango-dark
)(setq ansi-term-color-vector [unspecified “black” “red3” “lime green” “yellow3” “DeepSkyBlue?3” “magenta3” “cyan3” “white”])
但这现在导致错误:
"error in process filter: Invalid face; unspecified"
企图使用新面孔
term
,当我去M-x describe-face term
,我看到以下内容:[] Font Family
[] Font Foundry
[] Width
[] Height
[] Weight
[] Slant
[] Underline
[] Overline
[] Strike-through
[] Box around text
[] Inverse-video
[] Foreground
[] Background
[] Stipple
[x] Inherit
但是如何调整这些设置以获得与使用
ansi-term-color-vector
所达到的相同效果?更新
我仍然无法修复颜色。这是我得到的菜单
M-x customize-theme tango-dark
:这是终端中难以看到的颜色/面孔之一的示例:
最佳答案
这在 Emacs 24.3.1 中对我有用,可以设置 term 和 ansi-term 的颜色。只需将颜色更改为您喜欢的值(相应地调整背景)。
;; term
(defface term-color-black
'((t (:foreground "#3f3f3f" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-red
'((t (:foreground "#cc9393" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-green
'((t (:foreground "#7f9f7f" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-yellow
'((t (:foreground "#f0dfaf" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-blue
'((t (:foreground "#6d85ba" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-magenta
'((t (:foreground "#dc8cc3" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-cyan
'((t (:foreground "#93e0e3" :background "#272822")))
"Unhelpful docstring.")
(defface term-color-white
'((t (:foreground "#dcdccc" :background "#272822")))
"Unhelpful docstring.")
'(term-default-fg-color ((t (:inherit term-color-white))))
'(term-default-bg-color ((t (:inherit term-color-black))))
;; ansi-term colors
(setq ansi-term-color-vector
[term term-color-black term-color-red term-color-green term-color-yellow
term-color-blue term-color-magenta term-color-cyan term-color-white])
关于emacs - 在新的 Emacs 24.3 中调整术语面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15661372/