Offset error with autocompletion (with color+newline in PS1)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: bash
Recipe to reproduce:
1. Set PS1:
$ PS1="\[
{ /tmp }
$ _
2. Type "ls ./_ /foo" ("_" is where the cursor should be, just after "./".
3. Press TAB twice.
A list of available files in the current directory should get displayed and the internal cursor position (and the cursor itself) gets moved 11 chars to the right.
This is what the prompt looks like then ("_": cursor):
{ /tmp }
$ ls ./ /foo _
It appears that this bug gets triggered by color/non-visible chars _and_ a newline (\n) in PS1.
This is with 3.2.17(1)-release (3.2-0ubuntu8) (backported from Gutsy).
If someone can confirm this I will send it upstream.
Related branches
description: | updated |
Changed in bash: | |
status: | New → Confirmed |
Changed in bash: | |
status: | Confirmed → In Progress |
I can confirm this bug using 3.2.13(1)-release (i486-pc- linux-gnu) ! Following the above steps reproduces the buggy behavior. Here is another way to reproduce the bug:
1. Set PS1="\033[01;37m[ \[\033[ 01;34m\ ]\w\[\033[ 00m\] \033[01; 37m]\n\ $\033[00m "
2. Type "foo bar baz"
3. Press ctrl+a
3. Cursor should jump back to the beginning of the line, but instead jumps back to "foo b." This is how it looks like with "_" being the cursor:
foo b_ar baz