I have configured a fancy two-line PS1
bash prompt, with server name, time, user name and other useful variables.
PS1="\n\[\033[1;34m\]\342\226\210\342\226\210 \u @ $SERVER_NAME""$BBlue"" \w""$Color_Off \n\[\033[0;36m\]\342\226\210\342\226\210 \d \t $ \[\033[0;39m\]"
Full Github source here.
The problem is that long lines are often wrapped around themselves, meaning that the new line overlaps the previous one.
The problem is inconsistent: some lines are wrapped correctly, some are not.
Any idea how to fix this?
Here is my fancy two-line PS1 for bash prompt.
So here is what I did. If this was my color:
I changed it to:
Essentially you need to enclose it in:
Checkout this answer.
Found this solution online, which suggested a closing brackets to color variables:
Change this:
to:
I've committed the change - hope it works as expected.
My preferred solution to the issue of long lines overlap in bash PS1 is to have a
\n
at the end of PS1 prompt line(s).e.g.
If you want all my other stuff - time, user, host, directory and git branch(!) you can use this (mac or linux):
https://unix.stackexchange.com/a/124012/10043