Custom Bash Prompt Length PuTTY
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" Code:
[Wed Oct 10 11:41][root:~]# Code:
~]#d Oct 10 11:47][root:~ Thomas |
Quote:
[$BBlack[$Red\u$BBlack: :$Red\W$BBlack] Missing one ] in the prompt. You can learm more about it in the BASH PROMPT HOWTO. |
Not to sound rude, but what does that have to do with my prompt working with putty in full screen and not when it's not?
I could have 15 open brackets in my prompt and it not affect it. Click on that link that you posted and click on colors. All of the color escape codes have open brackets in them. The only close brackets in my prompt are purely aesthetic, ie: "[Wed Oct 10 11:41][root:~]#" |
Just for giggles...
Could you take your line
Code:
PS1="$MyDateTime\e[$BBlack[$Red\u$BBlack:$Red\W$BBlack]#\e[m" Code:
PS1="${MyDateTime}\e[$BBlack[$Red\u$BBlack:$Red\W$BBlack]#\e[m" |
Ok, well I added \] to all of my color codes, including my "stop color" and I still have the same problem. I added one escaped open bracket to the colors and now I am good.
For instance, before BBlack was: Code:
BBlack='\e[1;30m' Code:
BBlack='\[\e[1;30m\]' Thanks for looking at it. Thomas |
All times are GMT -5. The time now is 05:42 AM. |