petereon / beaupy

A Python library of interactive CLI elements you have been looking for
https://petereon.github.io/beaupy/
MIT License
200 stars 13 forks source link

Some items not shown in multiselect #57

Closed juxeii closed 1 year ago

juxeii commented 1 year ago

I have a really weird issue with select_multiple. Consider this snippet:

colored_options = [
        '1',
        '2',
        '3',
        '4',
        '5',
        '6',
        '7',
        '8']

print(colored_options)
print(len(colored_options))
select_multiple(colored_options)

In container A, in a python vscode terminal, everything works as expected: image

In another container, in a bash terminal, I only ever see 5 items: image

Why is the bash terminal only showing 5 items? How can I debug this?

petereon commented 1 year ago

Could you please share the version of beaupy this happens for?

What platform are you running on?

juxeii commented 1 year ago

Version: 3.3.0 Working container OS:

NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"

Not working container OS:

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"

Really strange, why 5 and not 8?

petereon commented 1 year ago

Could you please verify it's not 3.5.0 on the Debian? In 3.5.0 I have been making changes that could have introduced this bug.

Sorry, I am not at the computer atm so I can't verify.

EDIT: I have taken a quick look on the phone. I have most probably introduced a bug that could be causing this in 3.5.0. I will investigate and fix today.

juxeii commented 1 year ago

I am sorry, I gave you misinformation. On the working RedHat it is 3.4.0. On the misbehaving Debian it is indeed 3.5.0.

Edit: confirmed! Version 3.5.0 also does not work on RedHat

petereon commented 1 year ago

Thanks for correction. Fix should be reasonably easy, I'll release 3.5.1 fixing this later today.

petereon commented 1 year ago

Hi, I have released the fix, it's now available among GitHub releases and on PyPI

juxeii commented 1 year ago

It is working again, thank you for your fast support!

petereon commented 1 year ago

That's great to hear!

juxeii commented 1 year ago

I think there is a followup error on this: I have a list with 11 entries, but with the up and down keys I can only navigate to the fifth element. Pressing down from there then goes back up to the first entry. Since this happens to the fifth element, I guess this error is related to the other issue.

petereon commented 1 year ago

You are correct. I will be taking a look momentarily

petereon commented 1 year ago

Should be fixed, I am waiting for CI and then I'll merge and release. Note to self: I should really start doing beta releases :sweat_smile:

petereon commented 1 year ago

Okay, released as version 3.5.2, please see the GitHub Releases or PyPI

juxeii commented 1 year ago

Thx, it is working.

petereon commented 1 year ago

Perfect, apologies for the mess! If anything else comes up feel free to reopen or create a new issue.