unwanted space after directory completion (probably old cruft after upgrades)
Bug #1372286 reported by
latimerio
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
With bash-completion 2.1, some users are seeing broken completion for directories, with a space being added at the end, requiring a [BACKSPACE]/[TAB].
Testcase copied from bug 1000470, which I'm closing because it was probably from acroread.sh, which is now blacklisted.
Extra space scenario:
find /op<TAB> ==> find /opt<Space>
Backslash scenario:
cd ~
mkdir -p test\ 1/test
find test\ 1/t<TAB>
find test 1/test
find: `test': No such file or directory
find: `1/test': No such file or directory
This bug can get closed when we find out what other old files get left in /etc/bash_
summary: |
- tab bash-completion adds an unwanted space so path name expansion fails + unwanted space after directory completion |
Changed in bash-completion (Ubuntu): | |
status: | Incomplete → Confirmed |
To post a comment you must log in.
This doesn't happen on a normal Trusty system, but yeah, there are similar reports of this happening to people. Must be some kind of leftover stuff from upgrades. My system has an upgrade chain going back to Edgy (6.10), but I keep it tidy with aptitude and other tools.
You may have some cruft in your /etc/bash_ completion. d that's causing problems. Either from packages that were removed but not purged, or from obsolete conffiles (that the package owning them no longer supplies, but didn't remove during upgrade).
bug 1000470 looks like it was due to acroread's tab completion, which is blacklisted in Trusty. Does your bash_completion.d have a different name for acroread's adobe-supplied tab completion, that sneaks past the blacklist and breaks your programmable completion?
And check for obsolete conffile with:
dpkg-query -f '${Conffiles}\n' -W | grep 'obsolete$' | grep completion
I cooked up this perl script to go through the list and check if they match the stored md5sum from the package that provided them. And to print out the name of the package owning each one. \n${Conffiles} \n' -W |
dpkg-query -f '${Package}
perl -ane 'chomp; $pkg=$_ and next if !/^ /; $F[2] eq "obsolete" or next; -e $F[0] or print "no $F[0]\n" and next; ($localmd5)=split / /, `md5sum ${F[0]}`; print "$F[0] ". ($localmd5 eq $F[1] ? "un":"") . "modified in $pkg\n"; system "ls -l $F[0]";'
dpkg-query is just a fancy way to grep /var/lib/ dpkg/status, but don't tell anyone, because it's Better to use the documented API (dpkg-query), instead of digging in the file yourself. The lines recording obsolete conffiles are removed by dpkg when the package owning them is purged, upgraded, or reinstalled. (not just reconfigured).
also see http:// raphaelhertzog. com/2011/ 01/31/debian- cleanup- tip-1-get- rid-of- useless- configuration- files/ including one of the comments about obsolete conffiles leftover after package upgrades.