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

Arbitrarily trigger the Fish pager? #2805

Open
sagebind opened this issue Mar 9, 2016 · 7 comments
Open

Arbitrarily trigger the Fish pager? #2805

sagebind opened this issue Mar 9, 2016 · 7 comments

Comments

@sagebind
Copy link
Contributor

sagebind commented Mar 9, 2016

Is it possible to arbitrarily trigger the pager used in completions, either documented or undocumented? It would be useful to use the pager to make arbitrary choices interactively from scripts, perhaps by specifying a list of possible values in a similar manner as completion functions work.

@ridiculousfish
Copy link
Member

Great idea! No, I don't think this is possible yet.

@ridiculousfish ridiculousfish added this to the fish-future milestone Mar 10, 2016
@maxnordlund
Copy link
Contributor

If this happens it could be used instead of selecta or fzf, at least for small inputs, until the whole async completion happens somewhere far into the future.

@faho faho removed the question label Mar 19, 2016
@krader1961
Copy link
Contributor

This capability would be useful in my mcd (menu change directory) script I just documented in issue #2847. Being able to use the fish completion pager in a manner analogous to the Korn shell select command would be extremely useful.

@faho
Copy link
Member

faho commented May 18, 2017

Closing in favor of #4036.

@faho faho closed this as completed May 18, 2017
@faho faho removed this from the fish-future milestone May 18, 2017
@floam floam added this to the fish-future milestone Apr 6, 2019
@floam floam reopened this Apr 6, 2019
@floam
Copy link
Member

floam commented Apr 6, 2019

Reopened this. Looking for ideas on how people think this should work.

@floam
Copy link
Member

floam commented Apr 6, 2019

For some food for though, in theory this should have been possible before. Once upon a time many moons ago the pager was a separate process, fish_pager. I think it just took command line arguments for the number of rows and columns, items, and descriptions,. It would output the selected item to some temp file or fd number or something. It was undocumented and considered very internal.

@plainas
Copy link

plainas commented Apr 8, 2019

I believe there are these three basic building blocks to implement:

  • Trigger the UI with values from the output of a command. The command could be passed as a string
  • Handle interactivity. I.e. the filter mechanism. Not sure about this one. I guess in theory this could be handle by other functions. Or perhaps something like xargs -I argument ?
  • capturing the output into a variable (this is more or less solved problem)

Perhaps capturing a single line only would be good for a start

I am not a an experienced user of fish scripting. More of a user that writes the occasional function to scratch his own itch. So bear with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@floam @maxnordlund @ridiculousfish @plainas @sagebind @faho @krader1961 and others