bash autocompletion fails when name contains "illegal" (\t) characters

Bug #801093 reported by korkakak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

a file with filename (0001-\tNoise-reduction..patch as seen in the python execution) fails auto completion:

for instance an ls will fail after typing the first two 00 of the patch:
$ ls 00bash: [: 0001-: binary operator expected

in a ipython shell I am doing the following:
In [1]: import glob

In [2]: glob.glob("*.patch")
Out[2]: ['0001-\tNoise-reduction..patch']

obviously this is due to the tab (\t) embedded inside the filename but this is still an issue.

The file contents doesn't make any difference.

I also tried using more than one \t in the filename and it had interesting results.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bash-completion 1:1.1-3ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-31.61-server 2.6.32.32+drm33.14
Uname: Linux 2.6.32-31-server x86_64
Architecture: amd64
Date: Thu Jun 23 13:32:35 2011
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.2)
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
SourcePackage: bash-completion

Revision history for this message
korkakak (korkakak) wrote :
summary: - bash autocompletion fails when name contains "illegal" characters
+ bash autocompletion fails when name contains "illegal" (\t) characters
korkakak (korkakak)
description: updated
description: updated
Revision history for this message
Joachim R. (jro) wrote :

I think the bug is even worse, for example java completion doesn't work for classes that are in a folder with spaces (so not only tabs makes it fail) : if you have :
export CLASSPATH=/home/me/Java/Folder with space:/home/me/Java/FoderWithoutSpaces
then only classes in /home/me/Java/FoderWithoutSpaces will be seen by autocompletion, thought java is able to see classes in both folders.

Revision history for this message
Peter Cordes (peter-cordes) wrote :

touch $'tab\ttab'
echo ta[TAB] => works
echo tab<literal tab>ta[TAB] => works

so it's fixed in Trusty, or earlier.

Changed in bash-completion (Ubuntu):
status: New → Fix Released
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.