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

For } and ] key presses, getch() always returns 0 #41

Open
nathan-gilbert opened this issue Jan 18, 2023 · 5 comments
Open

For } and ] key presses, getch() always returns 0 #41

nathan-gilbert opened this issue Jan 18, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@nathan-gilbert
Copy link

I am working with Python 3.7 and on macOS/Linux the python curses library handles these keys correctly but on Windows using this library pressing either ] or Shift-] (to get }) the getch() method always returns 0. I've tried get_wchr and get_str as well to the same effect.

@ibondar-altilan
Copy link

I have the same effect with Python 3.10 under Windows 10. Furthermore, pressing (') - apostrophe key - always returns int 530.

@bartbroere
Copy link

I'm also experiencing this issue. The windows-curses project depends on PDCurses.
That means that the solution should be contributed to that project as well.
Simply updating to a newer version of PDCurses will not offer a solution I think, since I looked at the diff and not a lot has changed.

My best guess would be to start looking around here:
https://github.com/zephyrproject-rtos/PDCurses/blob/2e15c90f122fef329b83a4c3c011f192d97ec516/wincon/pdckbd.c

Probably somewhere next week I could look into this, submit a PR to PDCurses, and bump the submodule here as well. If anyone else has time before that, feel free to get started of course.

@asottile
Copy link

asottile commented May 6, 2023

this seems to have regressed between windows-curses 2.3.0 and 2.3.1 -- an easy reproduction is by trying to type either a ' or } in my text editor as reported here: asottile/babi#295 (comment)

@bartbroere
Copy link

Thanks @asottile. This information helped me fix this in visidata.

anjakefala pushed a commit to saulpw/visidata that referenced this issue May 16, 2023
Fixes #1841.

asottile noticed this was a regression in the last windows-curses release in this issue: zephyrproject-rtos/windows-curses#41
@isosphere
Copy link

isosphere commented Nov 20, 2023

pip install windows-curses==2.3.0

Resolved this problem for me - however, wheels for that version are only available for Python 3.10 and lower; that might be an issue for some folks.

See saulpw/visidata#2119 (comment) for some troubleshooting about this, including encoding/locale settings.

Mithil467 added a commit to Mithil467/mitype that referenced this issue Feb 25, 2024
Windows-curses bug introduced after v2.3.0 not
allowing to type apostrophe character.
zephyrproject-rtos/windows-curses#41
Mithil467 added a commit to Mithil467/mitype that referenced this issue Feb 25, 2024
Windows-curses bug introduced after v2.3.0 not
allowing to type apostrophe character.
zephyrproject-rtos/windows-curses#41
@stephanosio stephanosio added the bug Something isn't working label May 5, 2024
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

6 participants