Search code examples
linuxshellcolorsreadability

Can I change the default response color in Linux Terminal?


It would be nice to be able to easily see the conversations I have with my computer in 'call and response' style, so my input lines are in one color, and what is returned shows in a different one.


Solution

  • Add to your ~/.bashrc

    export CLICOLOR=1
    export PS1="\[$(tput setaf 1)\]\h:\W\\$ "
    

    This will enable colour for your terminal and set your prompt to dark red. The CLICOLOR may not be required on some systems, but for some (such as Mac OS X) it is disabled by default.

    A useful tool for building your own custom prompt can be found at https://www.kirsle.net/wizards/ps1.html