Reputation: 1438
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?
Upvotes: 19
Views: 19829
Reputation: 1475
Every time I install Cygwin on a new system, I have trouble getting tab completion to work the way I want it to, which is to scroll through the completion results with each TAB stroke rather than listing potential results and requiring that I continue until typing until finding a unique one that will actually complete with a TAB press.
The way to get it to scroll through valid results is to place the following command string in your ~/.bashrc
file:
bind TAB:menu-complete
Upvotes: 1
Reputation: 8794
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.
Upvotes: 14
Reputation: 6804
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'.
Upvotes: 15
Reputation: 13234
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.
Upvotes: 0
Reputation: 45324
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?
Upvotes: 3