Closed GoogleCodeExporter closed 8 years ago
Sounds like issue 191.
Original comment by andy.koppe
on 19 Oct 2012 at 11:46
You are correct. The PS1 prompt is what was doing it. In my case, the issue was
text reset: "\e[0m". I'm not sure why this broke it.
Thanks for the help.
Original comment by stevem...@gmail.com
on 19 Oct 2012 at 9:47
Bash/readline needs to know what column the cursor will be at after printing
the prompt, so that it can work out when the command line will wrap. Obviously,
non-printing characters shouldn't be counted towards that, hence the
requirement to enclose them in \[ and \]. I'd guess that it's done this way
(rather than by having readline recognise control sequences itself) in order to
keep readline fully terminal-independent.
See also http://www.gnu.org/software/bash/manual/bashref.html#Printing-a-Prompt.
(Btw, there is a control sequence for querying the cursor position from the
terminal, but that can be slow and error-prone, particularly over slow network
connections.)
Original comment by andy.koppe
on 21 Oct 2012 at 5:00
Original issue reported on code.google.com by
stevem...@gmail.com
on 14 Oct 2012 at 3:17