'cd' and 'rmdir' and others fail to complete directory paths past the first level if the first directory contains single quotes

Bug #1492906 reported by Jani Uusitalo
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Tab completion of directory paths containing single quotes is broken like so:

$ mkdir -p "a'b/c"
$ cd a\'b/ # pressing tab won't complete the 'c' dir

as opposed to:

$ mkdir -p "de/f"
$ cd de/ # pressing tab here completes the 'f' dir just fine, to 'de/f/'

I initially thought this was Bug #1485777, but the reason I'm not so sure anymore is that for me, a manually appended \' does not disappear (unlike for the reporter of #1485777). This does however also seem like a regression back to the issue of Bug #590829.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: bash-completion 1:2.1-4ubuntu0.1
ProcVersionSignature: Ubuntu 3.13.0-63.103-generic 3.13.11-ckt25
Uname: Linux 3.13.0-63-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.13
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Sep 7 09:12:04 2015
InstallationDate: Installed on 2010-01-15 (2060 days ago)
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
PackageArchitecture: all
SourcePackage: bash-completion
UpgradeStatus: Upgraded to trusty on 2015-08-31 (6 days ago)

Revision history for this message
Jani Uusitalo (uusijani) wrote :
description: updated
Revision history for this message
Jani Uusitalo (uusijani) wrote :

It's not the same as #590829 after all: despite the similarities, the recipe given at #590829 does not reproduce the issue for me.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Mathew Hodson (mhodson)
Changed in bash-completion (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Mathew Hodson (mhodson) wrote :

This only affects some commands. 'cd' and 'rmdir' and 'mkdir' are affected. My guess is that it affects commands that work exclusively with directories.

tags: added: testcase
Mathew Hodson (mhodson)
summary: - Fails to complete directory paths containing single quotes
+ 'cd' and 'rmdir' and others fail to complete directory paths past the
+ first level if the first directory contains single quotes
Revision history for this message
Mathew Hodson (mhodson) wrote :

Here is another testcase that produces a similar failure.

$ mkdir "Apostrophe's a problem"
$ mkdir "Apostrophe's still a problem"
$ cd Apostrophe\'s\<tab>

It should complete or offer options, but it doesn't complete any further and doesn't offer any suggestions.

If you add on to where it should be able to complete like so:

$ cd Apostrophe\'s\ still<tab>

It does not complete even though there is only one possibility.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.