Eugen Konkov
Eugen Konkov

Reputation: 25207

Why filename autocompletion do not work?

When I type command:

$ perl -Ilib t/mojolicious/pattTAB+TAB

Autocompletion works fine. But when I use -d option:

$ perl -Ilib -d t/mojolicious/pattTAB+TAB

It does not work. Why? How can I fix this?

UPD from comments

$ complete -p perl
bash: complete: perl: no completion specification

$ complete -D -p
complete -F _completion_loader -D

$ type _perl
bash: type: _perl: not found

$ type _completion_loader
_completion_loader is a function
_completion_loader () 
{ 
    local compfile=./completions;
    [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions";
    compfile+="/${1##*/}";
    [[ -f "$compfile" ]] && . "$compfile" &> /dev/null && return 124;
    complete -F _minimal "$1" && return 124
}

Upvotes: 2

Views: 224

Answers (1)

Jochen Lutz
Jochen Lutz

Reputation: 638

I have the same problem on Ubuntu 16.04. I just tried on Ubuntu 17.10, there the completion works flawlessly for perl -d teTAB+TAB.

So the easiest solution would be to update your system. If you can't (or don't want to) do that, you could try to get a newer package for your system. For Uubuntu, you could try the PPA at https://launchpad.net/~mail6543210/+archive/ubuntu/backports. Or you could get the upstream sources from http://bash-completion.alioth.debian.org/ and completely deactive the bash-completion provided by your distribution.

Upvotes: 1

Related Questions