Wednesday, April 6, 2011

Fixing my Bash Prompt on OSX

I have been having a problem with the bash prompt. When I use the up and down arrows to scroll throw the history buffer, the output of the previous commands would get garbled and not line up. After messing around for 20 minutes I found a solution.

My old prompt:

PS1='\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;31m\]$(parse_git_branch_and_add_brackets)\[\033[00m\]\$ '

My new prompt:

PS1='\[\e[01;32m\]\u@\h:\[\e[01;34m\]\w\[\e[0;31m\]$(parse_git_branch_and_add_brackets)\[\e[0m\]$ '

Something about changing the \033 to \e works. Why? I don't know, if you do please comment.

1 comment:

utaibanez said...

So this is not solely about slots, the actual fact} that|although} we've to say that their sport catalog for slots is pretty nice. Blackjack tournaments could be performed with many players. By playing in} multiple of} rounds – each consisting of a set variety of hands – this quantity is eventually lowered 토토사이트 to 6 or seven players at the ultimate desk.