Created
December 20, 2012 21:44
-
-
Save borodiychuk/4348835 to your computer and use it in GitHub Desktop.
Pretty and colored bash prompt.
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
export PROMPT_COMMAND='PS1="\[\033[0;33m\]\!\[\033[1;30m\]|\[\033[1;34m\]\$(date +%H:%M)\[\033[1;30m\]|\`if [[ $? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`\u.\h\[\033[1;30m\]:\[\033[1;37m\]\`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\` \`if [[ "`id -u`" = "0" ]]; then echo "\\[\\033[31m\\]"; else echo "\\[\\033[32m\\]"; fi\`\\$\[\033[0;0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"' |
@artvolk, this is the command number in the bash history. So later you can run the command from histoy by typing !123
in the shell prompt.
Thanks, already put in in all my .bashrc
files :)
Very very.
Thanks :)
It seems it breaks in Ubuntu local console (over SSH it works).
@artvolk: how comes that? I use it always on my local ubuntu.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And yes, maybe SVN revision \ git branch? :)