Giter Club home page Giter Club logo

Comments (14)

kislyuk avatar kislyuk commented on August 17, 2024

Thanks for reporting. I am unable to reproduce this on ubuntu 12.04 with 0.3.3 or 0.5.4 (latest). Can you install the latest version using pip and check if the problem persists? Uninstall the APT package and run sudo pip install argcomplete (install pip with apt-get install python-pip if it's not there). After you're done checking, you can uninstall the pip package if you want.

from argcomplete.

kislyuk avatar kislyuk commented on August 17, 2024

Also, could you let me know what your version of bash is?

from argcomplete.

Cookson avatar Cookson commented on August 17, 2024
$ bash --version
GNU bash, version 4.2.45(1)-release (i486-pc-linux-gnu)

I tried removing python-argcomplete package with apt-get and installed argcomplete with pip install argcomplete, and the problem persists. However it helps if I remove file /etc/bash_completion.d/python_argcomplete.sh — then completion works as usual, but without argcomplete functionality, of course. Here's the file just in case there is something wrong with it: http://pastebin.com/inbkPLAE

Registering python scripts for completion with register-python-argcomplete works fine as intended though.

from argcomplete.

Cookson avatar Cookson commented on August 17, 2024

By the way, /etc/bash_completion.d/python-argcomplete.py is not being removed neither on pip package uninstall, nor on .deb package uninstall, I guess that also might need fixing.

from argcomplete.

kislyuk avatar kislyuk commented on August 17, 2024

Thanks, need some more info, can you paste the output of:

grep complete /etc/bash_completion.d/*

In particular I'm interested in

grep complete /etc/bash_completion.d/*|grep -- -D

from argcomplete.

Cookson avatar Cookson commented on August 17, 2024

I have quite a number of files there:

$ ls
apache2.2-common          gem              insserv
colormgr-completion.bash  gem1.9.1         libreoffice.sh
debconf                   git              m-a
desktop-file-validate     grub             python-argcomplete.sh
django_bash_completion    initramfs-tools  quilt

Here is the result of grep complete /etc/bash_completion.d/*: http://pastebin.com/EQx65iyM

There is only one -D in the scripts — it is the -D from python-argcomplete.sh:

$ grep complete /etc/bash_completion.d/*|grep -- -D
/etc/bash_completion.d/python-argcomplete.sh:complete -o nospace -o default -D -F _python_argcomplete_global

I also tried moving everything out except python-argcomplete.sh and debconf (the one that provides apt-get completion) out of there: the issue remains, having python-argcomplete.sh doesn't allow completion from debconf.

I can monitor some results of python-argcomplete.sh while it is being run, if you need those to diagnose the problem. I can try altering your script to get some output of it.

from argcomplete.

kislyuk avatar kislyuk commented on August 17, 2024

Yeah, I'm not sure what's going on. I don't see any "complete -D" invocations in your scripts, and the manual says:

First, the command name is identified. If a compspec has been defined for that command, the compspec is used to generate the list of possible completions for the word. If the command word is the empty string (completion attempted at the beginning of an empty line), any compspec defined with the -E option to complete is used. If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. If those searches do not result in a compspec, any compspec defined with the -D option to complete is used as the default.

So (notwithstanding how python-argcomplete.sh will interact with other scripts that use -D) I'm not sure if I understand how python-argcomplete.sh would interfere with other scripts at all.

from argcomplete.

henryiii avatar henryiii commented on August 17, 2024

Has this been resolved? I'm having the same problem (ubuntu 13.04 and pip-installed). git and make (for example) quit completing.

from argcomplete.

henryiii avatar henryiii commented on August 17, 2024

Is this being used by bash, I wonder?

http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html

For instance, assuming that there is a library of compspecs, each kept in a file corresponding to the name of the command, the following default completion function would load completions dynamically:

_completion_loader()
{
. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
}
complete -D -F _completion_loader

from argcomplete.

henryiii avatar henryiii commented on August 17, 2024

Add

else
    type -t _completion_loader | grep -q 'function' && _completion_loader "$@"

after the completion part (outer if statement) to /etc/bash_completion.d/python_argcomplete.sh. This fixes bash completion for the other things.

from argcomplete.

kislyuk avatar kislyuk commented on August 17, 2024

Released in v0.5.6

from argcomplete.

henryiii avatar henryiii commented on August 17, 2024

Awesome! Pypi is acting rather odd, though. I'm getting the 0.5.5 version when I install using pip, even though it is the correct version on the pypi page. It downloads 0.5.6, but then it lists (pip list) as 0.5.5 and it's the old version of the script (at least). pip uninstall argcomplete after a fresh install shows argcomplete-0.5.5.egg-info being uninstalled. I installed from the tarball (from pypi!) and it worked just fine.

from argcomplete.

henryiii avatar henryiii commented on August 17, 2024

Works fine now! Was trying to install too soon.

from argcomplete.

kislyuk avatar kislyuk commented on August 17, 2024

Great, thanks for contributing.

from argcomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.