gum icon indicating copy to clipboard operation
gum copied to clipboard

gum choose selected is not selected

Open electriquo opened this issue 1 year ago • 6 comments

Describe the bug when providing gum choose --selected foo with many items it automatically span the items on multiple pages, if the given selected value (foo) is on a different page, gum will:

  1. not display the correct selection
  2. pressing enter (without doing anything else), returns the given selected value (foo) and not the highlighted value

To Reproduce

$ sel=$(echo -e "1\n2" | gum choose --selected 2 --height 1)
> 1

  ••

$ echo $sel
2

Expected behavior gum should select jump to the page where the given selected value (e.g. foo) appear and select the highlighted value

Desktop (please complete the following information):

  • OS: MacOS
  • Version 13.5
  • Gum version: 0.11.0

electriquo avatar Aug 17 '23 11:08 electriquo

I think this is the same issue as #394. It has already been fixed but there's not a new release yet.

piero-vic avatar Sep 06 '23 03:09 piero-vic

It has already been fixed but there's not a new release yet.

then a new release is a must :) thanks

electriquo avatar Sep 06 '23 06:09 electriquo

Tested, and it's indeed fixed in https://github.com/charmbracelet/gum/commit/6763de12e8e3ad28aa4c8baf4ce2816d564e1000, but not released yet.

fharper avatar Sep 18 '23 19:09 fharper

@fharper @piero-vic do you know when there will be a new release?

electriquo avatar Sep 19 '23 08:09 electriquo

No idea (I'm not a maintainer), but until they release, you can uninstall it, clone the repository, and go install .. You need Go installed though.

fharper avatar Sep 19 '23 15:09 fharper

@maaslalani apologies for pulling you in. do you know when there will be a new release?

electriquo avatar Oct 06 '23 05:10 electriquo