codekitty
codekitty

Reputation: 1438

cygwin file path tab completion not working

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

Answers (5)

jpf
jpf

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

cowlinator
cowlinator

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.

bash-completion as distinct installation module

Upvotes: 14

Emerick Rogul
Emerick Rogul

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

MaxVT
MaxVT

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

Jonathan Feinberg
Jonathan Feinberg

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

Related Questions