-
Notifications
You must be signed in to change notification settings - Fork 371
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
curses and SIGWINCH do not work properly with Hy. #1921
Comments
Can you provide a reproducible example? I can't try that program without |
Sorry, here are the two files required for a minimal example. main.py:
main.hy:
|
Thanks, I can confirm this. While unrelated to this bug, I should warn you against making one file named |
Thank you. Yes, I wouldn't normally have such a name collision, it was just quickly knocked up for the purposes of the example. |
Hilariously, this turns out to be a bug that's been in CPython for 13 years. Hy triggers it with |
After importing curses under hy, curses is unable to detect the size of the terminal as it is resized.
This manifests as curses.LINES and curses.COLS not being updated, stdscr.getmaxyx not working and so on.
However, the workaround of launching the hy program from python with:
allows curses to dynamically detect the size of the terminal.
I conclude therefore the problem is with the hy binary. My (limited) understanding acquired during tracking down the source of this problem is that curses uses the SIGWINCH signal, so perhaps that is a place to look.
Void linux x86 64bit, python 3.9.0
Freebsd 12.2, python 3.8.6
hy 0.19.0 (reported by pip) installed from git master branch via pip
The text was updated successfully, but these errors were encountered: