Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67108 - bash completion unnecessarily escapes colon (:)
Summary: bash completion unnecessarily escapes colon (:)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Shell Tools Herd Bugs
: 107684 (view as bug list)
Depends on:
Reported: 2004-10-11 07:21 UTC by Chris Boot
Modified: 2005-09-30 03:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Boot 2004-10-11 07:21:23 UTC
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.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
CFLAGS="-O2 -mcpu=athlon-tbird -march=athlon-tbird -fomit-frame-pointer
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
FEATURES="autoaddcvs ccache sandbox"
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"
Comment 1 Aaron Walker (RETIRED) gentoo-dev 2004-10-12 03:41:03 UTC
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.
Comment 2 Alexandre Veyrenc 2004-10-16 08:45:27 UTC
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.
Comment 3 Chris Boot 2004-11-01 00:37:53 UTC
I just emerged bash-completion-20040711 and the problem still occurs with this version.
Comment 4 Aaron Walker (RETIRED) gentoo-dev 2004-11-13 06:21:24 UTC
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

ciaranm, do you know of what is causing bash to automatically escape the colon?
Comment 5 Aaron Walker (RETIRED) gentoo-dev 2005-01-25 02:16:56 UTC
Finally heard back from upstream; As I suspected, bash itself automatically escapes the colon, so there's not much we can do about it.
Comment 6 Aaron Walker (RETIRED) gentoo-dev 2005-09-30 03:15:03 UTC
*** Bug 107684 has been marked as a duplicate of this bug. ***