-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: fish support #68
Comments
I don't use fish, and it's not a huge priority for me right now. I intend to do some work on it since both fish and zsh are great shells, but not if it takes a lot. With this said, I need some help from a fish expert. (ha, ha.) From what I can see in the API docs, fish has no way to specify a custom completer function at all in its completion engine: http://fishshell.com/docs/current/commands.html#complete - is this right? |
I am quite new to fish I'm afraid. But on further review it looks like you may be right. The appropriate solution might be for a Python module to generate of fish completion scripts based on it's argparser, which sounds out of scope for argcomplete. The references I've found so far were:
And my own question on this topic: http://stackoverflow.com/questions/20838284/how-can-i-provide-tab-completions-to-fish-shell-from-a-python-script (current answer: stop bugging everyone and write your fish completion script :) ) I've posted a doc request/query at fish-shell: fish-shell/fish-shell#1217 |
See fish-shell/fish-shell#1217 (comment) for a suggestion on dynamic completions. |
Cool - do you want to take a stab at adding fish support to https://github.com/kislyuk/argcomplete/blob/master/scripts/register-python-argcomplete? |
I'm afraid I cannot commit to doing this - if I find some time I will submit a merge request, but if any other pescetarians are interested, please don't let me hold you up. |
I will see if I can take a stab at this. As of at least 2.0, fish's |
A simpler alternative may be to generate man page (see https://bugs.python.org/issue14102) and then ask Fish to complete from man page. |
Following code: function __fish_myscript_complete
set -x _ARGCOMPLETE 1
set -x _ARGCOMPLETE_IFS \n
set -x _ARGCOMPLETE_SUPPRESS_SPACE 1
set -x _ARGCOMPLETE_SHELL fish
set -x COMP_LINE (commandline -p)
set -x COMP_POINT (string length (commandline -cp))
set -x COMP_TYPE
if set -q _ARC_DEBUG
myscript 8>&1 9>&2 1>/dev/null 2>&1
else
myscript 8>&1 9>&2 1>&9 2>&1
end
end
complete -c myscript -f -a '(__fish_myscript_complete)' in |
This reverts commit 3d213e6.
Fish support has been released in v1.10.0, please test. |
Would it be possible to also support completions in fish? https://github.com/fish-shell/fish-shell
The text was updated successfully, but these errors were encountered: