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

use within curses.wrapper() breaks input? #52

Open
snail-coupe opened this issue Nov 19, 2022 · 2 comments
Open

use within curses.wrapper() breaks input? #52

snail-coupe opened this issue Nov 19, 2022 · 2 comments
Assignees
Labels

Comments

@snail-coupe
Copy link

Version

Other (include below)

Operating System

Other (include below)

Environment

WSL Debian 11 bash within Microsoft Windows Terminal

What happened?

$ pip list | grep curses-menu
curses-menu       0.6.7
$ python -V
Python 3.9.2
$ uname -a
Linux Potoroo 5.15.68.1-microsoft-standard-WSL2 #1 SMP Mon Sep 19 19:14:52 UTC 2022 x86_64 GNU/Linux
$ head -1 /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"

I'm trying to use curses-menu to add a menu to an existing curses based app, however after doing so I find my calls to window.getch() break.

In the attached example I get and echo out a key press, then call CursesMenu.get_selection, then attempt to get and echo a key press again. This second time though my keypresses are just echoed to the console rather than caught by the getch()

test_curses_menu.py.txt

curses-menu.issue.mp4

For completeness the issue was also reproducible on my Raspberry Pi, connected via Putty to remove Windows Terminal from the mix.

$ pip list | grep curses-menu
curses-menu 0.6.7
$ python -V
Python 3.10.7
$ uname -a
Linux possum 5.15.61-v7l+ #1579 SMP Fri Aug 26 11:13:03 BST 2022 armv7l GNU/Linux
$ cat /etc/debian_version
11.5
@snail-coupe
Copy link
Author

fwiw - I had similar with another curses based menu - the issue there was the module ran it's core loop via curses.wrapper() which trashed my existing stdscr when it tore down. modifying that one to take an optional existing stdscr fixed it

@pmbarrett314
Copy link
Owner

That feels doable, I'll look into it.

@pmbarrett314 pmbarrett314 self-assigned this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants