Question

How can I set up Cygwin to have tab completion?

Actually, I do have it automatically, but it does not seem to complete paths. How do I set it up to complete paths?

Was it helpful?

Solution

Cygwin paths typically start with /cygdrive/c (substitute whatever drive letter you happen to be using, of course). So to complete c:\Program Files, you must type (for instance) /cygdrive/c/Prog and then press TAB.

Also, note that Cygwin is case-sensitive, so /cygdrive/c/prog would not complete to c:\Program Files due to the lowercase 'p'.

OTHER TIPS

I'm answering this question because the answer seems to have changed since the previous accepted answer. I just installed Cygwin, and found that the bash completion is in fact a distinct and separate installation module, "bash-completion". It is not selected in the default installation, so you need to install/update it explicitly.

bash-completion as distinct installation module

It's not cygwin per se that "has" tab completion; it's the shell you're using. By default, the cygwin shell is bash, which does indeed provide basic tab completion for executables on your path and files in the current directory. Does it not work for you?

Cygwin is just an environment; the program you're interacting with is called the shell. There are many shells - bash, zsh, and others.

For bash, I've found this set of instructions to modify your .inputrc file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top