IngoMeyer441 / simple-term-menu

A Python package which creates simple interactive menus on the command line.
MIT License
492 stars 43 forks source link

Scrolling through long Menu is extremly slow or crashes #49

Closed MangoSven closed 2 years ago

MangoSven commented 2 years ago

When i got a long list of items in my Menu and i hold the down key the scrolling is extremly slow. If i activate search_key=None and hold the down key, the menu crashes after the third entry.

The Menu:

simple-term-menu_menu

Crashlog with search_key=None

simple-term_menu_log

IngoMeyer441 commented 2 years ago

Thanks for your bug report. I tried to reproduce this behavior with

#!/usr/bin/env python3

from simple_term_menu import TerminalMenu

def main():
    terminal_menu = TerminalMenu(
        [f"veeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrry long item {i}" for i in range(1000)],
        search_key=None,
    )
    menu_entry_indices = terminal_menu.show()
    print(menu_entry_indices)
    print(terminal_menu.chosen_menu_entries)

if __name__ == "__main__":
    main()

but could neither produce the crash nor get a slowdown. Could you please send an example code? Which version of simple-term-menu do you use?

MangoSven commented 2 years ago

Very Strange. On my pc at Home i dont get it either. I will look onto it at my work computer in a few days and give you a little example code, if i can extract it

MangoSven commented 2 years ago

The Bug is gone. I tested the script under WSL1 and after upgrading to WSL2 this behaveor is gone.

IngoMeyer441 commented 2 years ago

Thanks for the feedback! I think WSL 1 can be considered obsolete, so we don't need to look into this further...