Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#22807 - [bash-completion] Completing directories will end in a space instead of an slash

Attached to Project: Arch Linux
Opened by Andreas Gohr (splitbrain) - Monday, 07 February 2011, 23:00 GMT
Last edited by Dan McGee (toofishes) - Friday, 11 February 2011, 20:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Eric Belanger (Snowman)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 8
Private No



Completing directories will end in a space instead of an slash. This makes navigation directory hierarchies very hard and should be fixed.

Additional info:
* version 1.3-1

Steps to reproduce:

* Enter /et[tab]
* Result: "/etc "
* Expected Result: "/etc/"
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 11 February 2011, 20:46 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Busted elsewhere in AUR package
Comment by Ionut Biru (wonder) - Monday, 07 February 2011, 23:09 GMT
you should really report this upstream. We do not modify any files
Comment by Eric Belanger (Snowman) - Tuesday, 08 February 2011, 05:43 GMT
I can't reproduce it. Works fine here.
Comment by Bender (magnon) - Tuesday, 08 February 2011, 16:32 GMT
On x86_64 with bash-completion-1.3-1: "/et[tab]" leads to "/etc/" as it should. However, e.g. "mplayer /et[tab]" leads to "mplayer /etc".
Comment by Kevin (anonymous_user) - Tuesday, 08 February 2011, 16:36 GMT
I cannot reproduce this on i686 either. Also "mplayer /et[tab]" works fine for me.
Comment by Bernd Pol (bernarcher) - Tuesday, 08 February 2011, 16:55 GMT
Same behavior here like Bender's. Also x86_64, bash-completion 1.3-1:
/et[tab] --> /etc/
ls /et[tab] --> ls /etc[space]
Comment by Olaf (Haderlump) - Tuesday, 08 February 2011, 19:03 GMT
Same behaviour, version and architecture as Bernd Pol (and bender).
Comment by Kevin (kjslag) - Tuesday, 08 February 2011, 22:52 GMT
I also have the problem, although it isn't 100% reliable.
Comment by Ernestas (ernetas) - Wednesday, 09 February 2011, 14:05 GMT
I have the same problem on i686. Though I asked on #archlinux IRC channel if anyone could help about it - it doesn't look like everybody's having it.
Comment by Eric Belanger (Snowman) - Wednesday, 09 February 2011, 16:42 GMT
One of you who are having this problem should ask upstream about it. They might be able to figure out what could be causing this. As I don't have this problem (same for other users), I can't really do anything. It's probably caused by a strange bug.
Comment by Olaf (Haderlump) - Wednesday, 09 February 2011, 19:35 GMT
Strange: Uninstalling and reinstalling resolved the issue for me. Can anyone verify this before we bother the upstream developers?
Comment by Ernestas (ernetas) - Wednesday, 09 February 2011, 19:57 GMT
Yeah, strange. Even more stranger - I didn't even need to reinstall it - it was already working after pacman -R bash-completion. What the hell? :D
Comment by Eric Belanger (Snowman) - Wednesday, 09 February 2011, 20:24 GMT
Did you guys logged off and relogin or rebooted since the update? If not, you could try it. Maybe the problem is due because you have the old /etc/bash_completion sourced but the files have changed.

Ernestas: You still had /etc/bash_completion sourced. To see the effect of removing bash-completion, logoff and relogin. Or use 'bash -l' to start a login shell.
Comment by Ernestas (ernetas) - Wednesday, 09 February 2011, 20:26 GMT
Eric, if I'd have the effect of bash_completion sourced, I would have the same problems at first. The logoff and relogin, even a reboot doesn't change anything, it works as it should now :) .
Comment by Bender (magnon) - Wednesday, 09 February 2011, 21:08 GMT
Removing bash-completion via pacman -R bash-completion leads to the correct behavior (but then without the extended completion support, of course).
However, reinstalling bash-completion and logging out and back in reproduces the problems as described above.
Comment by Bernd Pol (bernarcher) - Wednesday, 09 February 2011, 21:44 GMT
Well, removing bash-completion, relogging in, reinstalling bash-completion did work (on simple examples at least).
But relogging in after the reinstall made the problem re-appear.
Comment by Eric Belanger (Snowman) - Wednesday, 09 February 2011, 23:58 GMT
Try this:
-Install bash-completion
-Remove /etc/profile.d/ (the bash package already source /etc/bash_completion  FS#22832 )
Comment by Bender (magnon) - Thursday, 10 February 2011, 00:24 GMT
Sorry, doesn't change the behavior for me.
Comment by Paul Nicholson (brenix) - Thursday, 10 February 2011, 00:57 GMT
I had this issue and removed/reinstalled and it is working ok now...

One thing I noticed is after removal, there was still a /etc/bash_completion.d directory with about 10 files. I moved this directory and after the re-install there is over 40 files.. Don't know if this could help but it seems like it was missing some core files like bash-builtins etc...

Version: 1.3-1
Arch: x86_64
Comment by Bernd Pol (bernarcher) - Thursday, 10 February 2011, 02:41 GMT
There is probably some stale completion definition in /etc/bash_completion.d which caused the failure. Moving the folder out of the way, reinstalling bash-completion and relogging in appears to work here, too.

Obviously some other packages put their definitions in here, too. For instance there is a "yaourt" entry in the old folder which is missing now.
And a "yaourt -Ql yaourt" reveals exactly this:
yaourt /etc/bash_completion.d/yaourt

So copying back the missing definitions one by one and checking the completion behavior will most likely reveal the culprit.
Comment by Bernd Pol (bernarcher) - Thursday, 10 February 2011, 07:39 GMT
I think I found the culprit. Removing "acroread" from /etc/bash_completion.d (after copying back the missing files from the moved aside folder) did help. No more trailing spaces instead of folder slashes now.

Can somebody confirm this?
Comment by Guillermo (gmenguez) - Thursday, 10 February 2011, 12:05 GMT
Bernd, I was opening this page to post the same comment. I removed bash-completion, moved what was left at /etc/bash_completion.d/ to another place, reinstalled bash-completion and restored everything back file by file to find the same as you, that the file causing problems is /etc/bash_completion.d/acroread, installed by the AUR package acroread. I suppose it's not correct for this new version of bash-completion.


There's a workaround for this in, it worked for me.
Comment by Bernd Pol (bernarcher) - Thursday, 10 February 2011, 13:04 GMT
Thanks, Guillermo!
To note, the workaround is removing the "_filedir" function from the "/etc/bash_completion.d/acroread" file.

This works. I think this bug report can be closed.

[rant]The workaround was mentioned on December 31, 2010 on the acroread AUR page. A short note from the maintainer, in a post-install script perhaps, would have spared us quite some effort.[/rant]

Edit: I did put a comment about this on the acroread AUR page.