LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-20-2012, 02:31 PM   #16
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,344

Rep: Reputation: Disabled

Quote:
Originally Posted by colucix View Post
Good shot! Cycling through the command history is a mess. I cannot even delete the string using backspace, since it sticks when encounter the escape character.
It's makes sense; the shell has to know when you encounter the end of the terminal window in order to perform cursor positioning. The distance to EOL is the width of the terminal window - (whatever you type + the length of the prompt). Consequently, the length of the visible prompt must be known.

Last edited by Ser Olmy; 05-20-2012 at 02:39 PM.
 
Old 05-20-2012, 02:34 PM   #17
cryingthug
Member
 
Registered: Jun 2009
Posts: 131

Original Poster
Rep: Reputation: 18
Thanks!

I have taken out the brackets \[ and \].
I really did not need those.
Wow! Now it is all good.
Thanks!

Quote:
Originally Posted by Ser Olmy View Post
I think I just found out: Remove the brackets, and then try to cycle through your command history with the arrow keys.

But you can still use the exact same colour sequences, just put '\[' and '\]' around them when defining PS1.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
non-ascii characters in bash script and unicode igor.R Linux - Newbie 31 12-29-2012 03:45 AM
bash script to remove first characters from every line (00) Linux - General 8 08-01-2011 10:28 AM
Bash Script to get the first characters of a string onesikgypo Programming 12 11-14-2008 09:57 AM
Strange if statement behaviour when using bash/bash script freeindy Programming 7 08-04-2008 06:00 AM
inserting special characters into mysql with bash script ihopeto Linux - Newbie 1 12-05-2006 12:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration