简体   繁体   English

修改Emacs中的ansi-term颜色

[英]Modifying ansi-term colors in Emacs

The text in the red ellipse below is hard to read 下面红色椭圆中的文字很难阅读

在此输入图像描述

When I inspect the face with Cu Cx = (what face) I see the following: 当我用Cu Cx = (什么脸)检查脸部时,我看到以下内容:

在此输入图像描述

So I went to update the face term-bold (see below), but the color doesn't seem to match what I actually got on the screen above (it should be blue+yellow according to the face definition). 所以我去更新了面部term-bold (见下文),但颜色似乎与我在屏幕上面实际得到的颜色不一致(根据面部定义,它应该是蓝色+黄色)。 Any thoughts? 有什么想法吗?

在此输入图像描述

Emacs uses its own terminal colors to render ansi color codes. Emacs使用自己的终端颜色来渲染ansi颜色代码。 You can change the appearance of the face that you are referring to by changing two faces: 您可以通过更改两个面来更改您所指的面部的外观:

  • term-color-yellow
  • term-color-blue

For example, changing the foreground property of the face term-color-yellow to yellow3 , and the background property of the face term-color-blue to dark-blue results in the following appearance: 例如,将face term-color-yellow的foreground属性更改为yellow3 ,将face term-color-blue的background属性更改为dark-blue导致以下外观:

在此输入图像描述

which is more readable than the face in the original post and resembles the traditional appearance of the blue and yellow terminal colors. 这比原始帖子中的脸部更具可读性,类似于蓝色和黄色终端颜色的传统外观。

It's telling you that the face inherits from term-bold , and then over-rides the inherited foreground , background , and inverse-video properties. 它告诉你,face 继承term-bold ,然后覆盖了继承的foregroundbackgroundinverse-video属性。

I would guess the colours are coming from the shell (I assume it's a shell) that you're running in that terminal. 我猜这些颜色来自shell(我认为它是一个shell)你正在那个终端运行。 So you probably need to configure the colours outside of Emacs? 所以你可能需要在Emacs之外配置颜色?

The most efficient way to do that is to use the Emacs customization group 最有效的方法是使用Emacs自定义组

Mx customize-group RET term RET

This will open 这将打开

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM