我不知道如何禁用终端中的颜色(只是默认值,它叫gnu?)。找了一个小时,然后运行了一些我在其他地方看到的代码。还尝试了emacs〜/ .bashrc并添加了应该禁用颜色的行,它可以工作一次,然后我关闭终端,再次ls,然后颜色恢复了。任何帮助都很棒!
在.bashrc
文件中,您将找到以下行
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
在行的#
前面放一个注释符号,force_color_prompt=yes
然后重新启动终端。更改后,该行应为
#force_color_prompt=yes
编辑:这将从终端变成颜色。但是,如果某些程序内置有颜色支持,并且您也要关闭它们,请遵循@Zanna的回答。基本上,您需要注释掉诸如alias ls='ls --color=auto'
etc之类的行。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句