简体   繁体   English

如何使用Mx术语更改当前目录的字体颜色?

[英]How do i change the color of the font for the current directory in M-x term?

Normally when i need to change the color of a certain element in emacs, i would do a Mx describe-face which will eventually bring up a customize buffer to change it. 通常,当我需要更改emacs中某个元素的颜色时,我会执行Mx describe-face,这最终会带来一个自定义缓冲区来更改它。 In the emacs term, It seems like i dont have the ability to enter the minibuffer to input that command. 用emacs术语来说,似乎我没有能力输入minibuffer来输入该命令。 How do I figure out which variable to change? 如何找出要更改的变量?

Heres a picture, to make things a bit more clear: 这是一张图片,使事情变得更加清晰:

http://imgur.com/jXHNC.png http://imgur.com/jXHNC.png

Are you talking about the term you get to by doing Mx term ? 您是在谈论通过Mx term获得的Mx term吗? If so, you're probably not doing Cc Cj to enter line-run mode before you try to do Mx describe-face . 如果是这样,在尝试执行Mx describe-face之前,您可能没有使Cc Cj进入行运行模式。

I would bet that the color is being set by the shell, and not by emacs (which then considers it to be displayed in the default face). 我敢打赌,颜色是由外壳设置的,而不是由emacs设置的(然后emacs会将其显示为默认面)。 If you're using bash, the prompt is controlled using the environment variable PS1 , so try export PS1="\\u@\\h$ " to change the prompt to "username@host $ " with no coloring. 如果您使用的是bash,则使用环境变量PS1来控制提示,因此请尝试export PS1="\\u@\\h$ " ,将提示更改为“ username @ host $”,并且不着色。 If the change takes effect you can google for shell prompt color and find plenty of tutorials about what can be set, or doing the same for a different shell. 如果更改生效,您可以通过谷歌搜索shell prompt color并找到大量有关可以设置的教程,或者对其他shell进行相同的设置。

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

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