bash completion doesn't work in the middle of a word
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| bash-completion (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bug Description
Binary package hint: bash
In feisty, the /etc/bash_
find the token being completed. This isn't quite correct, since it always
returns the full token, even if the cursor is in the middle of the token.
For example, say the command line currently is:
$ ls foobar
^
and the cursor is on the 'b' character. Attempting to perform completion here
should complete the token "foo", and insert the results found before "bar".
With the current code, it tries to complete the full token "foobar", and then
inserts the results before "bar".
I occasionally run into this problem, for example, when I try to perform
completion on a file, but then realize I'm in the parent directory instead of
the directory I was thinking about. I type the filename and try to complete
it. When this fails, I realize I'm in the parent directory, so I go back to
the beginning of the token, insert the first few characters of the directory
name, and try to complete the directory name.
This works with bash's default builtin completion. However, if I have sourced
/etc/bash_
token, not just the part up to the cursor.
This can be fixed by examining $COMP_LINE and $COMP_POINT, instead of
${COMP_
Related branches
| Changed in bash: | |
| importance: | Undecided → Medium |
| status: | New → Confirmed |

This was fixed in 20060301-0ubuntu1