[Bash-completion-devel] [bash-completion-Bugs][311397] DBTS 267060: completion error commands/directories conflict

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Fri Jan 30 08:58:52 UTC 2009


Bugs item #311397, was opened at 30/01/2009 09:54
Status: Open
Priority: 3
Submitted By: David Paleino (hanska-guest)
Assigned to: Nobody (None)
Summary: DBTS 267060: completion error commands/directories conflict 
Distribution: None
Originally reported in: Debian BTS
Original bug number: 267060


Initial Comment:
From: Grahame <grahame at regress.homelinux.org>
To: Debian Bug Tracking System <submit at bugs.debian.org>
Subject: bash: completion error commands/directories conflict
Date: Fri, 20 Aug 2004 14:25:57 +0100

Package: bash
Version: 3.0-5
Severity: normal

if you have a directory that is the same name as a system command then the
directory will be completed when tab is pressed and not the command.

For example I have mutella installed and I also have a directory called
mutella in my home directory.

Now if I type mutel and then press tab (whilst in my home directory) bash
completes it to mutella/ and when return is then pressed bash complains:

-bash: mutella/: is a directory


----------------------------------------------------------------------

>Comment By: David Paleino (hanska-guest)
Date: 30/01/2009 09:58

Message:
What do you think?
Which approach should we take?

Waiting for comments (I've marked this as "wontfix" in DBTS, since I prefer completing on directories, but discussion is welcome)

David

----------------------------------------------------------------------

Comment By: David Paleino (hanska-guest)
Date: 30/01/2009 09:57

Message:
From: Chet Ramey <chet.ramey at case.edu>
To: Grahame <grahame at regress.homelinux.org>, 267060 at bugs.debian.org
Cc: chet at po.cwru.edu, Matthias Klose <doko at debian.org>
Subject: Re: Bug#267060: bash: completion error commands/directories conflict
Date: Sat, 28 Aug 2004 11:03:26 -0400

Matthias Klose wrote:

> Grahame writes:
> 
>>if you have a directory that is the same name as a system 
>> command then the directory will be completed when tab is
>> pressed and not the command.
>>
>>For example I have mutella installed and I also have a 
>> directory called mutella in my home directory.
>>
>>Now if I type mutel and then press tab (whilst in my home 
>> directory) bash completes it to mutella/ and when return 
>> is then pressed bash complains:
>>
>>-bash: mutella/: is a directory
> 
> 
> you could set mark-directories off in your .inputrc. 
> AFAIK there is no way to tell which of the two choices 
> takes precedence.

Damned if you do, damned if you don't.

At various times in bash's development history, I have implemented all three options:  let the command take precedence and append a space, let the directory take precedence and append a slash, and append nothing.

Every alternative generated its own set of complaints, some more vitriolic than others.

I'm favoring returning to the `append nothing' strategy and forcing the user to determine the appropriate alternative in an inherently ambiguous situation.

Chet

----------------------------------------------------------------------

Comment By: David Paleino (hanska-guest)
Date: 30/01/2009 09:55

Message:
From: Matthias Klose <doko at cs.tu-berlin.de>
To: Grahame <grahame at regress.homelinux.org>, 267060 at bugs.debian.org
Cc: chet at po.cwru.edu
Subject: Re: Bug#267060: bash: completion error commands/directories conflict
Date: Sat, 28 Aug 2004 15:55:43 +0200

Grahame writes:
> if you have a directory that is the same name as a system command then the
> directory will be completed when tab is pressed and not the command.
> 
> For example I have mutella installed and I also have a directory called
> mutella in my home directory.
> 
> Now if I type mutel and then press tab (whilst in my home directory) bash
> completes it to mutella/ and when return is then pressed bash complains:
> 
> -bash: mutella/: is a directory

you could set mark-directories off in your .inputrc. AFAIK there is no
way to tell which of the two choices takes precedence.

----------------------------------------------------------------------

You can respond by visiting: 
http://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311397&group_id=100114



More information about the Bash-completion-devel mailing list