开发者

How can I get auto-completion in bash for file-names with spaces, too?

开发者 https://www.devze.com 2023-01-22 08:38 出处:网络
I\'m pretty new to this whole Terminal business and had things working nicely on my old laptop with Snow Leopard installed.

I'm pretty new to this whole Terminal business and had things working nicely on my old laptop with Snow Leopard installed.

New laptop with Snow Leopard works differently, however. When usi开发者_运维知识库ng the terminal, when trying to get auto-completion to work, it won't auto-complete for directory names with spaces in them. I know I can type it in manually and escape that space, but I'd love to get auto-complete to work.

What can I do here?


You know, I'd swear this used to work and just seemed to stop working recently (last few months). Don't know that any OS X updates updated bash, but whatever.

Anyway, putting "complete -o nospace -d cd" into .bashrc (or whatever rc file you're using) seems to give the desired behavior.


Here is another solution which might be more straightforward. You have to the escape character \ followed by a space

e.g.

ls Xcode\ 5.0<tab>

Then "Xcode 5.0" would be considered as a whole string rather than two separate parameters.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号