How can I get bash paths/filename completion when they contain spaces?

How can I get bash paths/filename completion when they contain spaces?

Post by Paul Y. Pen » Tue, 23 May 2000 04:00:00

I wonder how I can complete a directory or a file with a space in
its name using TAB key under NTEmacs20.4, cygwin bash and Win98.

For example, in the root directory I can get the "Program Files"
directory completed using TAB key. But then if I press RETURN key,
I got message "bash.exe: cd: /Program: No such file or directory".
It will work if I manually insert "\" before the space in the name.
However, in this case further completion of any subdirectories is
not available. If, instead of inserting "\" before the space, I
manually replace "Program Files" with "Progra~1", the subdirectory
completion works as expected. I wonder if this is what I can do
best in the current version of NTEmacs or cygwin bash? If not,
how can I make it work flawlessly with spaces in names?
Thanks for help.


1. (ntemacs) tab completion not quoting spaces inside filenames on M-x shell (bash)

I'm using emacs 21.2 under Win2k, and cygwin/bash as my shell.

When in M-x shell I can press TAB to call shell-completion. But if the
returned file name contains embedded spaces, they are not being

For example, let's suppose that I want to cd to the "My Documents"

I start typing the folder name and press TAB to complete it:

bash# cd My<TAB>

The completion I get is:

bash# cd My Documents/

Since The space is not being quoted, the cd command perceives the
folder name as two different parameters.

When tried on standalone bash, however, the quoting is correct:

bash# cp My<TAB>


bash# cp My\ Documents/

I am wondering if there is a option that I can customize to get the
correct quoting behavior for shell inside emacs. Thanks in advance for
your suggestions.

2. NEC CDR-84 Firmware versions

3. grep on NT and paths containing spaces

4. Buck Rogers:Countdown to Doomsday

5. Filenames containing a '~'

6. cant even begin!!!!

7. xemacs + cygwin + bash and $PATH

8. Want DCTV

9. filenames with spaces

10. how can make xemacs show path along with filename

11. spaces in filenames -- weird behavior

12. ffap ff-paths & case-insensitve filenames