每次打开 gnome-terminal 看到的提示符都不是彩色的,很是不爽。也看了 .bashrc,没发现问题。找了一下,原来这是个 Bug 啊,看 Bash prompt string looks for xterm-color, gnome terminal identifies as xterm 这里。
修复方法也很简单,打开 .bashrc,在 27 行附近,有这么一段内容:
case “$TERM” in
xterm-color) color_prompt=yes;;
esac
在 xterm-color 前添加一个 “xterm|” 就可以了,也就是变成了:
case “$TERM” in
xterm|xterm-color) color_prompt=yes;;
esac
也不用重启也不用重新登录,直接打开一个新的 gnome-terminal 就看到彩色的 bash 提示符了。

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

This site uses Akismet to reduce spam. Learn how your comment data is processed.