Auto-completion in Bash

Asked by Johann Philipp Strathausen

Since my update to natty, the autocompletion behaviour of bash has changed. Here's an example (I use underscore _ here to show where the cursor is - there is no underscore in the actual file names.)

    user@machine:~$ ls MyF_<TAB>

completes to:

    user@machine:~$ ls MyFolder _

with a space behind the folder name instead of a slash. Actually I was expecting it to go like:

    user@machine:~$ ls MyF_<TAB>
    user@machine:~$ ls MyFolder/_<TAB>
    MyFolder/myInterestingFolder
    MyFolder/anotherFile.txt

Another annoyance is the handling of spaces.

    user@machine:~$ ls -1_<ENTER>
    My Folder With Spaces

    user@machine:~$ ls My_<TAB>
    user@machine:~$ ls My Folder With Spaces _

    user@machine:~$ ls My\ _<TAB>
    user@machine:~$ ls My Folder With Spaces _

    user@machine:~$ ls "My _<TAB>
    user@machine:~$ ls My Folder With Spaces _

This is really annoying. Deleting the .bashrc didn't help, I didn't find anything related in it anyway. Thanks for any help. This occurs only with some commands: cd seems to work fine, but cat or rm show the same behaviour.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

log a bug

Revision history for this message
Sam_ (and-sam) said :
#2

Unable to reproduce.
I've created two folders.
#1
Name: My Folder space
File: my file

CLI:
ls My<TAB>
completes it to: My\ Folder\ space/ [Enter]
my file

#2
Name: Folder_
File: myfile_

CLI:
ls Fo<TAB>
completes it to: ls Folder_/ [Enter]
myfile_

Revision history for this message
Sam_ (and-sam) said :
#3

Sorry, corrected last paragraph for #2:
CLI:
ls Fo<TAB>
completes it to: Folder_/ [Enter]
myfile_

Revision history for this message
Sam_ (and-sam) said :
#4

This is standard bashrc, don't forget a final new line.
http://paste.ubuntu.com/603503/

Can you help with this problem?

Provide an answer of your own, or ask Johann Philipp Strathausen for more information if necessary.

To post a message you must log in.