For } and ] key presses, getch() always returns 0
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.
I have the same effect with Python 3.10 under Windows 10. Furthermore, pressing (') - apostrophe key - always returns int 530.
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.
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: https://github.com/asottile/babi/issues/295#issuecomment-1537214493
Thanks @asottile. This information helped me fix this in visidata.
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 https://github.com/saulpw/visidata/issues/2119#issuecomment-1818084707 for some troubleshooting about this, including encoding/locale settings.
Fixed by v2.4.0. Please comment if this issue persists.