Skip to content
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

complete -C fails when recursing? #3474

Closed
Ambrevar opened this issue Oct 19, 2016 · 3 comments
Closed

complete -C fails when recursing? #3474

Ambrevar opened this issue Oct 19, 2016 · 3 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@Ambrevar
Copy link
Contributor

fish: 2.3.1, Arch Linux, urxvt 9.22

Enter complete -C"type p": only functions and builtins will get printed.
type has the following completion definition:

complete -c type -a "(complete -C(commandline -ct))" -x

Can you confirm the issue?

@faho faho added the bug Something that's not working as intended label Oct 19, 2016
@faho faho added this to the fish-future milestone Oct 19, 2016
@faho
Copy link
Member

faho commented Oct 19, 2016

Yes, I can reproduce this one. I could swear that it has already been reported, but I can't find that report currently.

The cause is probably that the inner commandline still gets the real commandline, while complete -C should enter an environment with a fake one.

@krobelus
Copy link
Member

krobelus commented Oct 2, 2019

This might be the same issue:

$ complete -c xx -fa 'arg'
$ complete -c zz -fa '(complete -C"xx ")'
$ complete -C"zz " # prints nothing (expected: arg)

Strangely, the interactive completion zz <TAB> completes arg just fine.

@krobelus
Copy link
Member

krobelus commented Oct 2, 2019

Apparently fish has never supported recursive calls to complete, going back to when complete was added in 521d09b#diff-886dfa5a4f8c2403307d30799f49b9efR460.
Perhaps this can be changed now (or at least print a warning informing the user).

krobelus added a commit to krobelus/fish-shell that referenced this issue Oct 3, 2019
Users should generally prefer to use complete --wraps but this
corrects some unexpected behavior.

Fixes fish-shell#3474
krobelus added a commit to krobelus/fish-shell that referenced this issue Oct 3, 2019
Users should generally prefer to use complete --wraps but this
corrects some unexpected behavior.

Fixes fish-shell#3474
krobelus added a commit to krobelus/fish-shell that referenced this issue Oct 3, 2019
Users should generally prefer to use complete --wraps but this
corrects some unexpected behavior.

Fixes fish-shell#3474
krobelus added a commit to krobelus/fish-shell that referenced this issue Oct 3, 2019
Users should generally prefer to use complete --wraps but this
corrects some unexpected behavior.

Fixes fish-shell#3474
@faho faho closed this as completed in e167714 Oct 3, 2019
@zanchey zanchey modified the milestones: fish-future, fish 3.1.0 Oct 3, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

4 participants