Created
October 27, 2016 15:44
-
-
Save rpetrano/23e5e8ec001c62303d31f5c78550d646 to your computer and use it in GitHub Desktop.
Bash prompt color tip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='[\e[00;32m\u\e[0m@\e[00;31m\h\e[0m \e[00;34m\w\e[0m]\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='[\[\e[00;32m\]\u\[\e[0m\]@\[\e[00;31m\]\h\[\e[0m\] \[\e[00;34m\]\w\[\e[0m\]]\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps1() { | |
green="\[$(tput sgr0)$(tput setf 2)\]" | |
red="\[$(tput sgr0)$(tput setf 4)\]" | |
blue="\[$(tput sgr0)$(tput setf 1)\]" | |
normal="\[$(tput sgr0)\]" | |
echo "$normal[$green\u$normal@$red\h $blue\w$normal]$ " | |
} | |
PS1="$(ps1)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment