Created
September 17, 2010 19:21
-
-
Save malcolmt/584774 to your computer and use it in GitHub Desktop.
People keep asking about my fancy bash prompt (I've been using it since the mid-90's). So, here it is.
This file contains hidden or 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
.-(malcolm@djelibeybi 15:19:34) ~ | |
`--> echo $PS1 | |
\n\[\033[35m\].-(\[\033[33m\]\u@\h \[\033[36m\]\t\[\033[35m\]) \[\033[0m\]\w\n\[\033[35m\]\`-->\[\033[0m\] | |
I should note that in my .bashrc file, I enter the information like this: | |
# My fancy two-line, colored prompt | |
e=\\\033 | |
export PS1="\n\[$e[35m\].-(\[$e[33m\]\u@\h \[$e[36m\]\t\[$e[35m\])\[$e[0m\]\w\n\[$e[35m\]\\\`-->\[$e[0m\] " | |
The $e variable is the escape character for ANSI terminal sequences. The wikipedia page for ANSI sequences is comprehensive, but a better summary for designing your own prompt might be http://ascii-table.com/ansi-escape-sequences.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment