I setup a custom bash prompt on one of my servers. When I log into the server via putty and the window is at the default size (not maximized), the prompt is messed up. The cursor is also in the middle of the prompt. As soon as I maximize the window, the prompt is fine.
My prompt is:
Code:
MyDateTime="\n\e[$BBlack[$Red\d \A$BBlack]\e[m"
PS1="$MyDateTime\e[$BBlack[$Red\u$BBlack:$Red\W$BBlack]#\e[m"
It is supposed to look like:
Code:
[Wed Oct 10 11:41][root:~]#
But when it is messed up, it looks like:
Code:
~]#d Oct 10 11:47][root:~
The cursor starts on the 'd' right after the '#'. I've tried a few things such as removing '$MyDateTime' from PS1 and typing it out manually. Also removed the '\n\r'. No change in results. Also please note that the window width is over three times the length of the prompt, so I wouldn't think it is getting too close. Maybe the prompt is too long anyway? Any ideas?
Thomas