No subject


Mon Mar 29 23:06:26 UTC 2010


> Since the most recent upload in sid, bash-completion does no longer to
> ~username completion (to homedirectories).

Simple test case: ls ~<TAB>

Looks like this was broken in commit c9c98da36edeb9305e24e7ea2d8ccf8b0934ce70. Freddy, it was committed by you, could you have a look?

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

>Comment By: Freddy Vulto (fvu-guest)
Date: 2010-07-02 08:18

Message:
The fix wasn't working on another computer and I found out Acrobat Reader (at
least version 9) is shipping its own completion, including its own `_filedir'
function, which conflicts with ours:

    $ shopt -s extdebug
    $ declare -F _filedir
    _filedir 3 /etc/bash_completion.d/acroread.sh
    $ ls -l /etc/bash_completion.d/acroread.sh
    lrwxrwxrwx 1 root root 46 2009-10-14 14:31
    /etc/bash_completion.d/acroread.sh ->
    /opt/Adobe/Reader9/Resource/Shell/acroread_tab
    $ declare -f _filedir
    _filedir () 
    { 
        local IFS='	
    ' xspec;
        xspec=${1:+"!*.$1"};
        COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "$xspec" -- "$cur" ) $( compgen -d -- "$cur" ))
    }
    
The problem becomes apparent when you don't set BASH_COMPLETION_COMPAT_DIR.  It then gets a default value of `/etc/bash_completion.d' and will include _filedir of Acrobat.

The workaround is to disable BASH_COMPLETION_COMPAT_DIR by setting:

    BASH_COMPLETION_COMPAT_DIR=$BASH_COMPLETION_DIR

or to remove the _filedir definition from acroread.sh.

Anyway, the more reason to work on our roadmap: create a namespace and a new directory layout...



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

Comment By: Freddy Vulto (fvu-guest)
Date: 2010-07-02 07:12

Message:
Fixed in commit 7b67991: Fix ls test
Append slash (/) or space (" ") to completion depending on whether `~user' home directory exists or not.

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

Comment By: Ville Skyttä  (scop-guest)
Date: 2010-07-01 19:19

Message:
The fix does not seem quite complete, it causes a test suite failure (ls.exp) for me with bash 4.1.7.  My dbg.log for it is attached.

$ ls ~<TAB>
~abrt/          ~avahi-autoipd  ~ftp            ~halt/          ~mysql/         ~ntp/           ~root/          ~saslauth       ~smolt/         ~usbmuxd/       
~adm            ~bin/           ~games/         ~lp/            ~nfsnobody/     ~openvpn/       ~rpc/           ~scop/          ~sshd/          ~uucp           
~apache/        ~daemon/        ~gopher         ~mail/          ~nobody/        ~operator/      ~rpcuser/       ~shutdown/      ~sync/          ~vcsa/          
~avahi/         ~dbus/          ~haldaemon/     ~mailnull       ~nscd/          ~pulse          ~rtkit/         ~smmsp          ~tcpdump/       

Notice how the ~adm, ~avahi-autoipd, ~ftp, ~gopher, ~mailnull, ~pulse, ~saslauth, ~smmsp, and ~uucp entries lack the trailing slash.  And they actually complete to those strings instead of the dirs. On a brief look it seems that this happens for users whose home dirs don't exist. Not sure if there's anything that can be sanely done about that, but IMO the test suite shouldn't fail.

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

Comment By: Freddy Vulto (fvu-guest)
Date: 2010-06-30 23:29

Message:
Fixed in commit ccbf141: Fix tilde (~) completion with _filedir


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

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



More information about the Bash-completion-devel mailing list