Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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:~]#"
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'
Now it is:
Code:
BBlack='\[\e[1;30m\]'
However, that still leaves us with a 2:1 offset of non-aesthetic open vs close brackets. But either way, it's working fine.
Thanks for looking at it.
Thomas
Last edited by sirEgghead; 10-10-2012 at 02:51 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.