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

curses: returns incorrect chars after resuming a suspended process #88020

Open
darrikonn mannequin opened this issue Apr 15, 2021 · 2 comments
Open

curses: returns incorrect chars after resuming a suspended process #88020

darrikonn mannequin opened this issue Apr 15, 2021 · 2 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@darrikonn
Copy link
Mannequin

darrikonn mannequin commented Apr 15, 2021

BPO 43854
Nosy @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-04-15.10:17:59.477>
labels = ['type-bug', '3.8', '3.9', '3.10', '3.7', 'library']
title = 'curses: returns incorrect chars after resuming a suspended process'
updated_at = <Date 2021-04-15.19:45:15.028>
user = 'https://bugs.python.org/darrikonn'

bugs.python.org fields:

activity = <Date 2021-04-15.19:45:15.028>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-04-15.10:17:59.477>
creator = 'darrikonn'
dependencies = []
files = []
hgrepos = []
issue_num = 43854
keywords = []
message_count = 2.0
messages = ['391126', '391151']
nosy_count = 2.0
nosy_names = ['serhiy.storchaka', 'darrikonn']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = None
status = 'pending'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue43854'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

@darrikonn
Copy link
Mannequin Author

darrikonn mannequin commented Apr 15, 2021

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.

@darrikonn darrikonn mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 15, 2021
@serhiy-storchaka
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
Status: Bugs
Development

No branches or pull requests

1 participant