Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holding the key-down causes TerminalMenu.show returns None on rlwrap #77

Open
minghu6 opened this issue Jun 14, 2023 · 7 comments
Open
Labels
bug Something isn't working

Comments

@minghu6
Copy link

minghu6 commented Jun 14, 2023

Env: Ubuntu 22.04, Python 3.10, Gnome Shell

Pressing down too quickly causes show returns None unexpectly (especially for the long menu).

And as a workaround, If I put the show method into a infinite loop, it also protects from quit shortcuts. (need a specific exception to indicate a quit event?)

@IngoMeyer441
Copy link
Owner

Thanks for the bug report. I tried to quickly press cursor down on a long list with 100 entries, but could not get your described behavior (on Ubuntu 22.04 with gnome terminal). Do you also use the default gnome terminal?

@IngoMeyer441 IngoMeyer441 added the bug Something isn't working label Jun 14, 2023
@minghu6
Copy link
Author

minghu6 commented Jun 14, 2023

Thanks for the bug report. I tried to quickly press cursor down on a long list with 100 entries, but could not get your described behavior (on Ubuntu 22.04 with gnome terminal). Do you also use the default gnome terminal?

Yes, i use default gnome shell (v42.5), sometimes it's ok, however if i rerun the script the issue occurs (just holding the key).

@minghu6
Copy link
Author

minghu6 commented Jun 14, 2023

Thanks for the bug report. I tried to quickly press cursor down on a long list with 100 entries, but could not get your described behavior (on Ubuntu 22.04 with gnome terminal). Do you also use the default gnome terminal?

Oh. I found the detail !, I run the script use an alias which is rlwrap python, that's if I run python in rlwrap (0.43-1build3 from ubuntu official repo) and then the issue occurs!

@minghu6 minghu6 changed the title Holding the key-down causes TerminalMenu.show returns None Holding the key-down causes TerminalMenu.show returns None on rlwrap Jun 14, 2023
@IngoMeyer441
Copy link
Owner

Python already has built-in edit support with libreadline. Do you really need rlwrap here?

@minghu6
Copy link
Author

minghu6 commented Jun 14, 2023

Python already has built-in edit support with libreadline. Do you really need rlwrap here?

It looks like i could use import readline to replace rlwrap.

@IngoMeyer441
Copy link
Owner

With rlwrap simple-term-menu $(seq 1 100) I can reproduce the behavior, you described. But I am not really sure if this is an issue with simple-term-menu or with rlwrap.

@minghu6
Copy link
Author

minghu6 commented Jun 14, 2023

With rlwrap simple-term-menu $(seq 1 100) I can reproduce the behavior, you described. But I am not really sure if this is an issue with simple-term-menu or with rlwrap.

I've tried another terminal menu on a Rust impl with rlwrap, and it's alright. Maybe there are some incompatiable on terminal manipulation or comflict on libreadline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants