CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.92k stars 236 forks source link

pagination for long list of options #42

Open manihamidi opened 5 years ago

manihamidi commented 5 years ago

Thank you for this wonderful library.

Was wondering if there is a way to paginate a long list of options?

Alternatively, is there a way to have the list of options printed in multiple columns so as to fit as many options in the smallest rectangular space on the console as possible?

:question:

CITGuru commented 5 years ago

Give more example

manihamidi commented 5 years ago

I mean something like what ipython does:

Mar-24-2019 13-08-52

That is,

a) Instead of listing the options vertically one below the other, list them in a rectangular fashion (kind of like the default console ls output) and b) Instead of printing all of the options onto the screen at once, limit the vertical width of the rectangle and "paginate" whatever doesn't fit in the rectangle in view, i.e. allow user to scroll through to the next "page" of the the "choices" by clicking the right arrow key.

Does that make sense?

If the feature doesn't exist already, let me know if/how I can help.

CITGuru commented 5 years ago

This is more like a new feature. I'll be glad if you are able to send a PR on this.

manihamidi commented 5 years ago

Thanks, I'll give it a shot.

CITGuru commented 5 years ago

Coool, I will be on look out