bash cygwin 选项卡完成

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1803701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 21:26:05  来源:igfitidea点击:

cygwin tab completion

bashcygwin

提问by codekitty

How can I set up Cygwin to have tab completion?

如何设置 Cygwin 以完成选项卡?

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

实际上,我确实自动拥有它,但它似乎没有完成路径。如何设置它以完成路径?

采纳答案by Emerick Rogul

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/Progand then press TAB.

Cygwin 路径通常以/cygdrive/c(当然,替换您碰巧使用的任何驱动器号)开头。因此,要完成c:\Program Files,您必须键入(例如)/cygdrive/c/Prog然后按TAB

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

另请注意,Cygwin 区分大小写,因此由于小写的“p”而/cygdrive/c/prog无法完成c:\Program Files

回答by cowlinator

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.

我正在回答这个问题,因为自上一个接受的答案以来,答案似乎发生了变化。我刚刚安装了 Cygwin,发现 bash 完成实际上是一个独特且独立的安装模块,“bash-completion”。默认安装中未选择它,因此您需要明确安装/更新它。

bash-completion as distinct installation module

bash-completion 作为不同的安装模块

回答by Jonathan Feinberg

It's not cygwin per se that "has" tab completion; it's the shellyou'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 本身;这是您正在使用的外壳。默认情况下,cygwin shell 是 bash,它确实为您的路径上的可执行文件和当前目录中的文件提供了基本的 tab 补全。它不适合你吗?

回答by MaxVT

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

Cygwin 只是一个环境;您正在与之交互的程序称为外壳。有很多 shell - bash、zsh 和其他。

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

对于 bash,我找到了这组指令来修改您的 .inputrc 文件。