Bug 1215362

Summary: bash completion for 'cd' doesn't work if the path contains spaces
Product: [Fedora] Fedora Reporter: James Heather <drfudgeboy>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: ooprala, sheltren, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-27 07:25:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Heather 2015-04-25 19:46:49 UTC
Description of problem:

I have a directories called

  /home/james/Documents/bible/by reference/
  /home/james/Documents/bible/by topic/

and each has several subdirectories.

If I have bash-completion installed, I can't tab-complete further than the space. It'll get as far as

  cd /home/james/Documents/bible/by\ 

and then won't list possible completions with a double tab, and won't complete either of the possibilities if I start typing "reference" or "topic". If I finish that element of the path manually, it won't complete on anything further down the tree.

If the "by topic" path didn't exist, I'd get similar behaviour: it would complete the "by\ reference/" part for me, but wouldn't go any further.

In other words, it appears that once there's already a "\ " in the path, it won't do any further completion.

Even weirder if I try quoting. If I type

  cd "/ho

and hit tab, it already fails by that point. (Earlier, I think.) If I try a single quote, it works well up to the point where the space appears, and then we enter a strange world:

  cd '/home/james/Documents/bible/by ref

I hit tab and it becomes

  cd '/home/james/Documents/bible/by reference'/

Note that the quote has been closed for some reason. Now if I start typing the next part...

  cd '/home/james/Documents/bible/by reference'/ac

I hit tab and it morphs into

  cd /home/james/Documents/bible/by\ reference/acts/

Note that the quotes have now disappeared entirely, and the space has been escaped.

This is an up to date Fedora 21 system, running

bash-4.3.33-1.fc21.x86_64
bash-completion-2.1-6.20141110git52d8316.fc21.noarch

Comment 1 Ville Skyttä 2015-04-27 07:25:35 UTC

*** This bug has been marked as a duplicate of bug 1171396 ***