simple-term-menu icon indicating copy to clipboard operation
simple-term-menu copied to clipboard

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

Open minghu6 opened this issue 2 years ago • 7 comments

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?)

minghu6 avatar Jun 14 '23 09:06 minghu6

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 avatar Jun 14 '23 09:06 IngoMeyer441

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 avatar Jun 14 '23 10:06 minghu6

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 avatar Jun 14 '23 10:06 minghu6

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

IngoMeyer441 avatar Jun 14 '23 10:06 IngoMeyer441

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.

minghu6 avatar Jun 14 '23 13:06 minghu6

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.

IngoMeyer441 avatar Jun 14 '23 14:06 IngoMeyer441

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?

minghu6 avatar Jun 14 '23 14:06 minghu6