cygwin 文件路径选项卡完成功能不起作用

发布于 2024-08-12 17:53:23 字数 70 浏览 3 评论 0原文

如何设置 Cygwin 来完成制表符?

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

Bonjour°[大白 2024-08-19 17:53:23

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

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

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'.

萌酱 2024-08-19 17:53:23

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

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

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

暖伴 2024-08-19 17:53:23

cygwin 本身并不“具有”制表符补全功能;这是您正在使用的shell。默认情况下,cygwin shell 是 bash,它确实为路径上的可执行文件和当前目录中的文件提供基本的制表符补全。这对你不起作用吗?

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?

泼猴你往哪里跑 2024-08-19 17:53:23

Cygwin 只是一个环境;与您交互的程序称为 shell。有许多 shell - bash、zsh 等等。

对于 bash,我找到了这套说明来修改您的 .inputrc 文件。

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.

空城之時有危險 2024-08-19 17:53:23

每次我在新系统上安装 Cygwin 时,我都无法按照我想要的方式完成制表符补全,即用每个 TAB 笔划滚动完成结果,而不是列出潜在的结果和要求我继续输入,直到找到一个唯一可以通过按 TAB 键完成的输入。

让它滚动浏览有效结果的方法是将以下命令字符串放入您的 ~/.bashrc 文件中:

bind TAB:menu-complete

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文