Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
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.
Now it does show me some colors but what happens is when I press UP arrow (to see previous commands) it starts to scroll UP and shows the command on the line above the prompt line and then if i press up arrow again, it just keeps going up.
It's pretty close to working I think, just not exactly what you want.
Thank you again - what is the fix for UP arrow behavior? It takes me to upper line (while still on unix prompt) if the previous command issued was longer one (does not fit on one line)? I hope you understand what I am trying to say :-(
I tried to look at some solutions,
like here (at the bottom)
Quote:
I had the same issue, and I don't think the problem has to do with the TERM variable. In fact, I tried changing it to "ansi" myself, and emacs got all screwed up.
You didn't put the value of PS1 in your original post, so I can only assume you're having the same issues I was, which was failing to mark the ANSI escape sequences as non-printing characters.
Before I had the following value for PS1:
'\e[0;34m\h:\w [\!]\$\e[0m '
which gave me a nice blue prompt of the following form
hostname:working-directory [command-number]$
However, I had the same line-wrapping problem you did. The fix was to insert \[ and \] around the ANSI escapes so that the shell knows not to include them in the line wrapping calculation. This results in the following value for PS1:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.