AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 350 forks source link

Show abreviate "selected" text after multiselect OR don't show what was selected? #411

Closed blacktop closed 2 years ago

blacktop commented 2 years ago

I am using a multi select with LONG strings as the choices, however, if I select more than one it displays the selects in a weird way.

Is it possible to have an "abbreviated" version or the selected items OR just not show that text?

Thank you!

EXAMPLE:

❯ dist/ipsw download macos
? Choose installer(s):  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
  [ ]  macOS Mojave                       10.14.5  18F2059  14Oct2019 20:38:26
  [ ]  macOS Mojave                       10.14.6  18G103   14Oct2019 20:51:08
  [ ]  macOS High Sierra                  10.13.6  17G66    19Oct2019 18:19:55
  [ ]  macOS Mojave                       10.14.4  18E2034  23Oct2019 14:41:18
  [ ]  Install macOS High Sierra Beta     10.13.5  17F66a   23Oct2019 14:41:18
  [ ]  macOS Catalina                     10.15.3  19D2064  23Mar2020 21:41:00
  [ ]  macOS Catalina                     10.15.4  19E2269  04May2020 15:32:04
  [ ]  macOS Catalina                     10.15.5  19F2200  15Jun2020 18:52:41
  [ ]  macOS Catalina                     10.15.6  19G2006  06Aug2020 23:39:24
  [ ]  macOS Catalina                     10.15.6  19G2021  12Aug2020 20:04:02
  [ ]  macOS Catalina                     10.15.7  19H2     24Sep2020 17:09:31
  [ ]  macOS Catalina                     10.15.7  19H4     27Oct2020 17:28:13
  [ ]  macOS Catalina                     10.15.7  19H15    11Nov2020 17:48:09
  [ ]  macOS Big Sur                      11.5.2   20G95    18Aug2021 18:28:53
  [ ]  macOS Monterey                     12.0.1   21A559   01Dec2021 21:42:57
  [ ]  macOS Big Sur                      11.6.1   20G224   01Dec2021 21:44:37
  [ ]  macOS Monterey                     12.1     21C52    14Jan2022 18:42:59
  [ ]  macOS Big Sur                      11.6.2   20G314   14Jan2022 18:44:26
  [ ]  macOS Monterey                     12.2     21D49    26Jan2022 18:17:23
  [ ]  macOS Big Sur                      11.6.3   20G415   26Jan2022 18:26:15
> [x]  macOS Monterey                     12.2.1   21D62    17Feb2022 18:38:45
  [x]  macOS Big Sur                      11.6.4   20G417   17Feb2022 18:41:29
  [x]  macOS Monterey beta                12.3     21E5222a 23Feb2022 18:01:16

POST SELECTION

❯ dist/ipsw download macos
? Choose installer(s): macOS Monterey                     12.2.1   21D62    17Feb2022 18:38:45, macOS Big Sur                      11.6.4   20G417   17Feb2022 18:41:29, macOS Monterey beta                12.3     21E5222a 23Feb2022 18:01:16
? You are about to download 3 installer(s). Continue? (y/N)

notice the gross wrap around text of my 3 selections?

mislav commented 2 years ago

You probably want to display showing of answers in the updated prompt line. A workaround for that is here: duplicate of https://github.com/AlecAivazis/survey/issues/407#issuecomment-1031791930