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

create interactive functions with autocomplete options #7823

Closed
mbristol78 opened this issue Mar 15, 2021 · 1 comment
Closed

create interactive functions with autocomplete options #7823

mbristol78 opened this issue Mar 15, 2021 · 1 comment

Comments

@mbristol78
Copy link

fish 3.1.2
ubuntu 18.04

Hello,
is there a way to create tab completion within a function?
The complete feature of fish seems to give the ability to have arguments passed to a function, but let say I have a function foo
which, when invoke, can ask the user a choice, like "do_this" or "do_that", available and select-able with the keyboard arrows?
A bit like when you do a "cd" and press tab, you have the list of the folders you can go into.
That would replace a code like
echo "Enter do_this or do_that"; read USER_RESPONSE

with ideally something easy to use like
read_pre-defined_choice' USER_RESPONSE ('do_this do_that')

Which would save the user from typing "do_this" or "do_that"

Thanks

@faho
Copy link
Member

faho commented Mar 15, 2021

There currently is no way to arbitrarily trigger fish's completion pager from script.

That's tracked in #2805, so I'm closing this as a duplicate.

@faho faho closed this as completed Mar 15, 2021
@faho faho added the duplicate label Mar 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants