Bug 1215362 - bash completion for 'cd' doesn't work if the path contains spaces
Summary: bash completion for 'cd' doesn't work if the path contains spaces
Keywords:
Status: CLOSED DUPLICATE of bug 1171396
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-25 19:46 UTC by James Heather
Modified: 2015-04-27 07:25 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-04-27 07:25:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.