Debian Bug report logs - #377935
bash: [COMPLETION] completion of ':' mangles filename

Package: bash-completion; Maintainer for bash-completion is Gabriel F. T. Gomes <gabriel@debian.org>; Source for bash-completion is src:bash-completion (PTS, buildd, popcon).

Reported by: Chris Moore <dooglus@gmail.com>

Date: Tue, 11 Jul 2006 23:48:38 UTC

Severity: normal

Tags: wontfix

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, dooglus@gmail.com, Matthias Klose <doko@debian.org>:
Bug#377935; Package bash. (full text, mbox, link).


Acknowledgement sent to Chris Moore <dooglus@gmail.com>:
New Bug report received and forwarded. Copy sent to dooglus@gmail.com, Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Chris Moore <dooglus@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: bash: [COMPLETION] completion of ':' mangles filename
Date: Wed, 12 Jul 2006 01:36:00 +0200
Package: bash
Version: 3.1-5
Severity: normal

Create a file called 'abc:def':

$ touch abc:def

Type a command, and part of the filename, then hit tab:
$ rm abc:[TAB]

The filename gets completed incorrectly:
$ rm abc:abc\:def

I source /etc/bash_completion in my ~/.bashrc

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages bash depends on:
ii  base-files                    3.1.13     Debian base system miscellaneous f
ii  debianutils                   2.16.2     Miscellaneous utilities specific t
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libncurses5                   5.5-2      Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#377935; Package bash. (full text, mbox, link).


Acknowledgement sent to Chris Moore <dooglus@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #10 received at 377935@bugs.debian.org (full text, mbox, reply):

From: Chris Moore <dooglus@gmail.com>
To: 377935@bugs.debian.org
Subject: Re: [COMPLETION] completion of ':' mangles filename
Date: Thu, 22 Feb 2007 00:45:44 +0100
This is still a problem (ash 3.1dfsg-8), and I just noticed another way that it manifests itself:

I have package 'libstdc++6-doc' installed, and want to view the man page for
std::multimap

I type:

  $ man std::multim

and hit tab, expecting it to be completed, but instead I see it completed like this:

  $ man std::std\:\:multimap

If instead I type

  $ man std\:\:multim

and hit tab, it is completed correctly like this:

  $ man std\:\:multimap



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#377935; Package bash. (full text, mbox, link).


Acknowledgement sent to Reuben Thomas <rrt@sc3d.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #15 received at 377935@bugs.debian.org (full text, mbox, reply):

From: Reuben Thomas <rrt@sc3d.org>
To: Debian Bug Tracking System <377935@bugs.debian.org>
Subject: bash: This bug is still present; any news?
Date: Wed, 23 Jan 2008 16:36:22 +0000
Package: bash
Version: 3.1dfsg-8
Followup-For: Bug #377935

This bug is still present and annoying me most times I want to look up
a Perl man page. Any news? Any way I can help?

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (700, 'testing'), (601, 'unstable'), (600, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23-1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files                4.0.2          Debian base system miscellaneous f
ii  debianutils               2.28.2         Miscellaneous utilities specific t
ii  libc6                     2.7-5          GNU C Library: Shared libraries
ii  libncurses5               5.6+20071215-1 Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information




Bug reassigned from package `bash' to `bash-completion'. Request was from Luk Claes <luk@debian.org> to control@bugs.debian.org. (Sun, 02 Mar 2008 15:25:46 GMT) (full text, mbox, link).


Tags added: wontfix Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Sun, 11 May 2008 13:21:06 GMT) (full text, mbox, link).


Information stored:
Bug#377935; Package bash-completion. (full text, mbox, link).


Acknowledgement sent to David Paleino <d.paleino@gmail.com>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #24 received at 377935-quiet@bugs.debian.org (full text, mbox, reply):

From: David Paleino <d.paleino@gmail.com>
To: 377935-quiet@bugs.debian.org
Cc: Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>, Chris Moore <dooglus@gmail.com>, Reuben Thomas <rrt@sc3d.org>
Subject: Re: completion of ':' mangles filename
Date: Sun, 11 May 2008 15:20:02 +0200
[Message part 1 (text/plain, inline)]
tags 377935 wontfix
thanks

Hi Reuben, hi Chris,

On Wed, 12 Jul 2006 01:36:00 +0200, Chris Moore wrote:

> Package: bash
> Version: 3.1-5
> Severity: normal
> 
> Create a file called 'abc:def':
> 
> $ touch abc:def
> 
> Type a command, and part of the filename, then hit tab:
> $ rm abc:[TAB]
> 
> The filename gets completed incorrectly:
> $ rm abc:abc\:def

On Thu, 22 Feb 2007 00:45:44 +0100, Chris Moore wrote:

> This is still a problem (ash 3.1dfsg-8), and I just noticed another way that
> it manifests itself:
> 
> I have package 'libstdc++6-doc' installed, and want to view the man page for
> std::multimap
> 
> I type:
> 
>  $ man std::multim
> 
> and hit tab, expecting it to be completed, but instead I see it completed like
> this:
> 
>  $ man std::std\:\:multimap

On Wed, 23 Jan 2008 16:36:22 +0000, Reuben Thomas wrote:

> Package: bash
> Version: 3.1dfsg-8
> Followup-For: Bug #377935
> 
> This bug is still present and annoying me most times I want to look up
> a Perl man page. Any news? Any way I can help?

":" is a special Bash character [1], and we can't do anything about that.
However, completion works just fine when not including the colon:

$ touch foo:foo
$ rm f[TAB]
$ rm foo\:foo
$ rm "f[TAB]
$ rm "foo:foo"


I believe bash-completion can't do anything in this case. So, please, if you
know there are colons in the completed name (be it a filename, or a Perl module
manpage), start it with '"', or escape the first colon. I'm sorry I can't help
any more.

Fellow developers, the usual disclaimer: I've tagged this as "wontfix", but
feel free to retag at will. I believe it might be reassigned to bash, but I'll
wait for discussion (here or on the mailing list).


Kindly,
David

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377935
[1] http://tldp.org/LDP/abs/html/special-chars.html#NULLREF

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Information stored:
Bug#377935; Package bash-completion. (full text, mbox, link).


Acknowledgement sent to Reuben Thomas <rrt@sc3d.org>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #29 received at 377935-quiet@bugs.debian.org (full text, mbox, reply):

From: Reuben Thomas <rrt@sc3d.org>
To: David Paleino <d.paleino@gmail.com>
Cc: 377935-quiet@bugs.debian.org, Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>, Chris Moore <dooglus@gmail.com>
Subject: Re: completion of ':' mangles filename
Date: Sun, 11 May 2008 14:34:06 +0100 (BST)
On Sun, 11 May 2008, David Paleino wrote:

> ":" is a special Bash character [1], and we can't do anything about that.

There's clearly a bug here: at the very least, non-existent, incorrect 
completions should not be produced. More reasonably, bash's completion 
mechanism should be fixed.

Hence, please reassign the bug as you think fit; I agree that assignment to 
bash would seem to be the obvious choice.

-- 
http://rrt.sc3d.org/ | Caution Children At Play Drive Slowly (Anon)




Information stored:
Bug#377935; Package bash-completion. (full text, mbox, link).


Acknowledgement sent to David Paleino <d.paleino@gmail.com>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #34 received at 377935-quiet@bugs.debian.org (full text, mbox, reply):

From: David Paleino <d.paleino@gmail.com>
To: Reuben Thomas <rrt@sc3d.org>
Cc: Chris Moore <dooglus@gmail.com>, 377935-quiet@bugs.debian.org, Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>
Subject: Re: completion of ':' mangles filename
Date: Sun, 11 May 2008 15:42:22 +0200
[Message part 1 (text/plain, inline)]
On Sun, 11 May 2008 14:34:06 +0100 (BST), Reuben Thomas wrote:

> On Sun, 11 May 2008, David Paleino wrote:
> 
> > ":" is a special Bash character [1], and we can't do anything about that.
> 
> There's clearly a bug here: at the very least, non-existent, incorrect 
> completions should not be produced.

The version I currently have does not produce the output you reported, i.e.:

$ man Debian[TAB]
Debian::DictionariesCommon  DebianNet
$ man Debian:[TAB]
$ man Debian:

That means, it does not produce "non-existent, incorrect completions". I have
bash-completion/20060301-4 installed, try that.

> More reasonably, bash's completion mechanism should be fixed.
> 
> Hence, please reassign the bug as you think fit; I agree that assignment to 
> bash would seem to be the obvious choice.

I'll wait for other people's comments about this. I've just started hacking
bash-completion, hence I may have missed something.

Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Information stored:
Bug#377935; Package bash-completion. (full text, mbox, link).


Acknowledgement sent to Reuben Thomas <rrt@sc3d.org>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #39 received at 377935-quiet@bugs.debian.org (full text, mbox, reply):

From: Reuben Thomas <rrt@sc3d.org>
To: David Paleino <d.paleino@gmail.com>
Cc: Chris Moore <dooglus@gmail.com>, 377935-quiet@bugs.debian.org, Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>
Subject: Re: completion of ':' mangles filename
Date: Sun, 11 May 2008 14:49:42 +0100 (BST)
On Sun, 11 May 2008, David Paleino wrote:

> That means, it does not produce "non-existent, incorrect completions". I 
have
> bash-completion/20060301-4 installed, try that.

I don't have a sid or lenny system at the moment, and only production etch
systems that I don't want to mess with sorry. (I recently switched to 
Ubuntu
on my personal machines; it's got an Ubuntu-modded version of -3 in 
hardy.)

--
http://rrt.sc3d.org/ | RSA, n.  safety in numbers




Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#377935; Package bash-completion. (Sun, 16 Aug 2009 17:18:04 GMT) (full text, mbox, link).


Acknowledgement sent to Klaus Ethgen <Klaus@Ethgen.de>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Sun, 16 Aug 2009 17:18:04 GMT) (full text, mbox, link).


Message #44 received at 377935@bugs.debian.org (full text, mbox, reply):

From: Klaus Ethgen <Klaus@Ethgen.de>
To: 377935@bugs.debian.org
Cc: Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>
Subject: Re: completion of ':' mangles filename
Date: Sun, 16 Aug 2009 18:16:13 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

first let me say that this is the most annoying bug in bash-completions!

I often work with perl files so having to view the manpage:
 > perldoc Locale[Tab]
 Display all 183 possibilities? (y or n)y
 ...
 > perldoc Locale\:\:[Tab again or add more letters and then tab]
 -> nothing happens at all.

There are many other uses where the completed line gets completely
wrong.

Am So den 11. Mai 2008 um 14:20 schrieb David Paleino:
> tags 377935 wontfix

Please reset this tag as this bug is the worse one of bash-completions.

> ":" is a special Bash character [1], and we can't do anything about that.
> However, completion works just fine when not including the colon:

This is simply wrong! ":" is not special, it is just a internal command.
Using it inside of the arguments have no special meaning.

> $ touch foo:foo
> $ rm f[TAB]
> $ rm foo\:foo
> $ rm "f[TAB]
> $ rm "foo:foo"

That works as long as you do not have a file, say "foo:bla" too.

> I believe bash-completion can't do anything in this case.

Well, I believe it just can leave the ":" as it is if it is in the
arguments and leave it as it is if it is the command. That would solve
all problems.

> So, please, if you know there are colons in the completed name (be it
> a filename, or a Perl module manpage), start it with '"', or escape
> the first colon. I'm sorry I can't help any more.

Doesn't work at all:
 > perldoc "Locale::[Tab]
 -> nothing happens.

> Fellow developers, the usual disclaimer: I've tagged this as "wontfix", but
> feel free to retag at will. I believe it might be reassigned to bash, but I'll
> wait for discussion (here or on the mailing list).

But why should it be retagged to bash? Bash do not handle ":" special at
all. There is no need ever to escape it.

> [1] http://tldp.org/LDP/abs/html/special-chars.html#NULLREF

Yes, please read it, there is no evidence that ":" is special. However
it is a internal command. But with that you have to escape exit to like
 > man 2 exit[Tab]
 ...
 > man 2 \e\x\i\t
 (please don't! It is just an example.)

Am So den 11. Mai 2008 um 14:42 schrieb David Paleino:
> $ man Debian[TAB]
> Debian::DictionariesCommon  DebianNet
> $ man Debian:[TAB]
> $ man Debian:
> 
> That means, it does not produce "non-existent, incorrect completions". I have
> bash-completion/20060301-4 installed, try that.

Ok, try:
 > perldoc Locale[Tab]

> I'll wait for other people's comments about this. I've just started hacking
> bash-completion, hence I may have missed something.

So there is a other people, me. :-)

Well, let me go further a bit. There is the following solutions:
   1. Just do not escape the ":" at all.

   2. If you think that you want to escape it, then the following points
      have to be implemented:
      - If there is a verbatim ":", replace it with "\:" and go on with
	completions (This is the way how it is at the moment)
      - If there is still "\:" just go on with the completion (This is
	not implemented at the moment. If there is "\:" you seems to
	stop completion completely.)

Regards
   Klaus

Ps. Ah yes, I do not think that this make any sense but I use version
    1:1.0-3.
- -- 
Klaus Ethgen                            http://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQEVAwUBSog+3Z+OKpjRpO3lAQodowf/TOzqXfsxetsdq9Hfx92NG9jPUGegj9Qg
EusTJ/qeYPQlaVCl/i1quXKjEstuBNIxpHuurRJ0pN6nEZzWcJt42VRCjbn00eM/
D6r9jNmEupjJPvAEMTQZf7NwG1VrA4CRyPmH21MEWusnH8q2oIfIwAEHaULxPfSK
I63Z81Mk1cJ5/c+qNjwfgf2EOydPVBFc//K6b/dKZwIQ2mycEg5OqqXDAv2KNKiV
Oj+gDasmoJx2sy3SdnevGdvoUP/VmUtCNjD+01kQhPvHMAVjbmOSR0QffS4QqysD
Sy2gjYtyG44wOm0d/LpvwJSQJqflMD2HglTPJB3GH13lvGMKVFfP9Q==
=jxXq
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 09:14:24 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.