Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 using 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?

like image 834
panzhuli Avatar asked Oct 29 '10 16:10

panzhuli


1 Answers

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.

like image 91
smparkes Avatar answered Oct 09 '22 12:10

smparkes