This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: curses: returns incorrect chars after resuming a suspended process
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: darrikonn, serhiy.storchaka
Priority: normal Keywords:

Created on 2021-04-15 10:17 by darrikonn, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg391126 - (view) Author: (darrikonn) Date: 2021-04-15 10:17
Using the arrow keys after resuming a suspended process yields `27 (escape)` from `getch`/`get_wch`/...

Steps to reproduce:

```
# test.py
from curses import wrapper

def main(stdscr):
    # Clear screen
    stdscr.clear()

    key = 0
    while key != 27:
    	key = stdscr.getch()
        stdscr.addstr(0, 0, str(key))

    stdscr.refresh()

wrapper(main)
```

1. python test.py
2. ctrl-z
3. fg
4. <arrow_down>

This gives the char `27` which is the escape character and therefore exits the python script.
msg391151 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-04-15 19:45
Python method is just a thin wrapper around corresponding curses function (wgetch() in this case). It looks like an issue is in the curses library. We cannot do anything with it.
History
Date User Action Args
2022-04-11 14:59:44adminsetstatus: pending -> open
github: 88020
2021-04-15 19:45:15serhiy.storchakasetstatus: open -> pending

nosy: + serhiy.storchaka
messages: + msg391151

resolution: third party
2021-04-15 10:17:59darrikonncreate