I researched further on this (and was helped by Nafallo and persia in
#ubuntu-bugs).

Eventually I found this answer from the upstream maintainer, in the bash
FAQ (ftp://ftp.cwru.edu/pub/bash/FAQ, question E3):

"E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence."

-- 
non-ASCII characters in PS1 cause cursor to appear in wrong place
https://bugs.launchpad.net/bugs/102179
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to