在线上有许多教程/帖子(例如http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/)有关如何通过设置在bash中自定义提示的信息PS1。有没有一种方法可以自定义我键入的命令的颜色/粗体?
换句话说,举例来说,我想要一个绿色提示,一个粗体蓝色命令,然后以任何默认颜色输出。在下面的示例中,我已经知道如何joe>通过设置使“ ”显示为绿色,蓝色,粗体PS1。但是,有什么方法可以使我git status以粗体显示吗?
joe> git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
...
preexec() { printf '\e[0m' }