aisk / pick

create curses based interactive selection list in the terminal
MIT License
729 stars 63 forks source link

Support multiline options #44

Closed ignaciocabeza closed 2 years ago

ignaciocabeza commented 4 years ago

Hi @wong2,

I was using your library in my project and I found that if your options are multiline, the second (and consecutive lines) of that option are overlapped by the following options.

So, I did a fix in case you want to add it in the library.

Also I added an example showing how works.

wong2 commented 4 years ago

Hi thanks for your pull request! I have two suggestions:

  1. I think we need some separation between these multiline options, they look like 10+ single options now image
  2. After selecting an option and press enter, I got this error:
    Traceback (most recent call last):
    File "example/multiline_options.py", line 23, in <module>
    option, index = picker.start()
    ValueError: not enough values to unpack (expected 2, got 0)
ignaciocabeza commented 4 years ago

Thanks for the quick response.

About 2): I'll look at that and I will add some tests maybe.

About 1): I notice that is confusing, but I wasn't sure on how to resolve. If you have any suggestions would be perfect. Options I'm thinking: