Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

keyInSelect has a limit of 35 array elements #47

Closed
smks opened this issue Oct 2, 2016 · 3 comments
Closed

keyInSelect has a limit of 35 array elements #47

smks opened this issue Oct 2, 2016 · 3 comments

Comments

@smks
Copy link

smks commented Oct 2, 2016

I have to display a huge list of directories so that the user can choose from one of them. What is the reason for the limit of 35?

@anseki
Copy link
Owner

anseki commented Oct 2, 2016

Hi @smks, thank you for the comment.

  • For the user, the list should not be too long. The size of many terminal windows is small, then your app should have a pagination (like more command) to show the long list.
  • keyInSelect is used for simple interface. 0 .. 9, A .. Z keys are found easily by user.
  • The keys other than the 36 keys (includes 0) are not many, if you want to receive multiple keys such as the item number for long list, you can use questionInt method. But I think that it's not good idea as I said. The list should be split. For example: https://github.com/anseki/readline-sync#itemscount

@smks
Copy link
Author

smks commented Oct 2, 2016

I decided to use a columnify npm package, and built 4 columns of options to format and compact it a bit better. I then use a questionInt to grab the index. Great package by the way!

@smks smks closed this as completed Oct 2, 2016
@anseki
Copy link
Owner

anseki commented Oct 2, 2016

😃

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

No branches or pull requests

2 participants