bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conflicts between "complete" and "complete-filename"


From: Henning Bekel
Subject: Conflicts between "complete" and "complete-filename"
Date: Sat, 22 May 2010 20:07:41 +0200
User-agent: KNode/4.4.3

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -
DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -
DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -
DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -march=i686 -
mtune=generic -O2 -pipe
uname output: Linux box 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 
CEST 2010 i686 AMD Athlon(tm) XP 2200+ AuthenticAMD GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 4.1
Patch Level: 7
Release Status: release

Description: 
        When the first word of the command line is a path containing
        slashes and ending in a slash or a partial filename of a
        non-executable file, if completion is attempted first via the
        readline function "complete" and after that with
        "complete-filename", then completion fails and
        "complete-filename" behaves similar to "complete" in that it
        only matches executable files and directories.
        
Repeat-By:
        $ mkdir foo
        $ touch foo/bar
        $ bind '"\ew": complete-filename'
        
        $ foo<tab>   # completes to foo/
        $ foo/<tab> # no matches, as expected, but then
        $ foo/<\ew> # no matches either, should complete to foo/bar
        
        likewise:
        $ foo<tab>    # completes to foo/, I type 'b' and then do
        $ foo/b<tab> # no matches, as expected, but then
        $ foo/b<\ew> # no matches either, should complete to foo/bar

        whereas:
        $ fo<tab>    # completes to foo/
        $ foo/<\ew>  # completes to foo/bar, just like  
        $ foo/b<\ew> # completes to foo/bar, too

        To get out of "being stuck with regular complete":

        $ foo/b<tab> # "I'm stuck", so I <del> back to "foo"
        $ foo<tab>   # completes to foo/
        $ foo/<\ew>  # again completes to foo/bar alright

The reason I want to complete to non-executable files is that
I have a prompt command that reacts to "permission denied" and
passes the path entered to xdg-open, so I can "open" files
from the bash in an external application.

Alternatively, is there a way to just have regular "complete"
match non-executable filenames as well? As far as I understand
it from the manual, there isn't... am I mistaken?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]