4

For a while now I'm experiencing an annoying bash-completion problem, namely it doesn't work when a path contains an escaped space. For example, I am in /cygdrive/c and type

$ cd Pro

pressing Tab key completes to "cd Program", pressing twice shows all directories with this "Program" prefix:

Program Files/       Program Files (x86)/ ProgramData/

I want to cd to "Program Files" so I type

$ cd Program\ 

(with space after backslash) and from now on pressing Tab does nothing. It used to work some time ago but I cannot identify when exactly it stopped. Any hints on what can be the cause of this?

7
  • 1
    The only time I've encountered this is when the shell thinks your prompt is ambiguous. When I do this on my system it correctly picks "Program\ Files" and prompts me for the next part of the completion. – AlG Aug 26 '15 at 18:14
  • Yup, it seems to work sometimes. For example if I create a directory test\ test in my home dir, it completes. Then when I add another directory test\ test2 it only completes to test\ test, but then it doesn't want to suggest the rest of the path. After deleting test\ test, completion for test\ test2 starts to work again... Weird – Piotr Aug 26 '15 at 21:01
  • 1
    Works fine here. Sorry! – AlG Aug 27 '15 at 15:06
  • 2
    Does it help if you remove the bash_completion package or run complete -r cd? I was having your problem with cd but not other programs like ls and the those changes fixed the problem. – BeingQuisitive Nov 8 '15 at 2:49
  • 1
    @BeingQuisitive Yup, I tried running complete -r cd and it fixed the issue. Removing the package wasn't necessary. If you write an answer I will accept it.Thanks! :) – Piotr Nov 9 '15 at 9:00
5

It looks like the there is a problem with the bash_completion package. I was having your problem with cd but not other programs like ls. You can either remove that package or put complete -r cd in your .bashrc.

1
  • 2
    FWIW, upgrading bash-completion from 1.3 to 1.3.1 fixed this for me. – dwlz Apr 19 '16 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.