Comments (14)
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.
Also, could you let me know what your version of bash is?
from argcomplete.
$ 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.
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.
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.
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.
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.
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.
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.
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.
Released in v0.5.6
from argcomplete.
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.
Works fine now! Was trying to install too soon.
from argcomplete.
Great, thanks for contributing.
from argcomplete.
Related Issues (20)
- `argcomplete` adds entries to `.bash_completion`, even when action is abandoned HOT 1
- installing zsh globally adds paths to completion options introduced in v3.1.4 HOT 1
- Contributing guidelines for argcomplete? HOT 2
- How do I exclude files in the users directory from the tab completion? HOT 2
- Unable to get completion to work for NetExec HOT 2
- zsh: completion fails with script path starting with '~/' HOT 1
- 3.2.2: pytest is failing HOT 1
- Output of `argcomplete.warn` does not show HOT 4
- Generating lazy completion scripts for Bash/Zsh HOT 1
- Problem with os.get_terminal_size() and argcomplete HOT 2
- completion with a leading dash HOT 2
- Problems with trust path when packaging HOT 6
- No automatic testing on windows? HOT 2
- Python 3.13: Some tests fail when run with latest Python pre-release HOT 5
- Check recent argparse API changes for compatibility HOT 2
- completer falls back to Bash filename completion
- Python 3.12.3: Test suite fails HOT 1
- autocompletion is slow and stuck HOT 2
- Issue with File Path Autocompletion in Argparse Outside Virtual Environment HOT 6
- Inconsistent completion when using a custom validator between `fish` and `bash` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argcomplete.