The bash completion system escapes colons when it really need not do so. I'm seeing this behaviour with at least chown and perldoc. Reproducible: Always Steps to Reproduce: 1. Fire up a bash shell 2. Type "chown adm" 3. Press <tab> to perform the completion Actual Results: The completed command appeared as: "chown adm\: " Expected Results: It should have appeared as: "chown adm:" I've tried this on 3 separate x86 machines and one sparc box. It has been happening since I installed Gentoo, almost 3 months ago. I've been making sure to update everything every week using 'emerge sync' and 'emerge -avuD world'. Portage 2.0.50-r11 (x86, gcc-3.3.4, glibc-2.3.3.20040420-r2, 2.6.8-gentoo-r3) ================================================================= System uname: 2.6.8-gentoo-r3 i686 AMD Duron(tm) Processor Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=athlon-tbird -march=athlon-tbird -fomit-frame-pointer -fforce-addr" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=athlon-tbird -march=athlon-tbird -fomit-frame-pointer -fforce-addr" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://mir.zyrianes.net/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage//packages/x86/" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage/" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="acl apache2 berkdb crypt fam gdbm hardened idea imap ipv6 ldap maildir ncurses nls nptl pam perl pic pie png python readline sasl spell ssl tcpd threads truetype vhosts x86 xml2 zlib"
I've also seen this with du, and I'm sure there's others ; I'll see if I can track this down today or tomorrow even though this is most likely an upstream bug.
This is even worse with cdrecord. Reproducible: Always Steps to Reproduce: 1. Fire up a bash shell 2. Type "cdrecord blank" 3. Press <tab> to perform the completion 4. Delete the trailing space 5. Press <tab> to perform another completion Expected Results: It should have appeared as: "cdrecord blank" and should have displayed the possible options for the blank parameter. Tested with every bash-completion versions in portage from bash-completion-20040526 to bash-completion-20040711.
I just emerged bash-completion-20040711 and the problem still occurs with this version.
I've been trying to track this down... the only thing I can think of, is that bash is automatically escaping the ':' for some reason. I'm wondering if maybe there's an option you have to (un)set. I'll use chown for this example with my username, ka0ttic. # chown ka0<TAB> # chown ka0ttic\: Now, in the completion function, _chown(), the previous "use case" causes _chown() to execute 'compgen -S : -u -- $cur' where $cur is the first 3 letters I typed in before hitting <TAB>. Trying this manually on the command-line, shows that it doesn't escape the colon: # compgen -S : -u -- ka0 ka0ttic: ciaranm, do you know of what is causing bash to automatically escape the colon?
Finally heard back from upstream; As I suspected, bash itself automatically escapes the colon, so there's not much we can do about it.
*** Bug 107684 has been marked as a duplicate of this bug. ***