Title: pyrepl messed up terminal if a signal handler expects stdin · Issue #130168 · python/cpython · GitHub
Open Graph Title: pyrepl messed up terminal if a signal handler expects stdin · Issue #130168 · python/cpython
X Title: pyrepl messed up terminal if a signal handler expects stdin · Issue #130168 · python/cpython
Description: Bug report Bug description: This is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though) Start REPL from a terminal and do import signal signal.signal(signal.SIGINT, lambda s, f: input("t...
Open Graph Description: Bug report Bug description: This is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though) Start REPL from a terminal and do import signal signal.sig...
X Description: Bug report Bug description: This is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though) Start REPL from a terminal and do import signal signal.sig...
Opengraph URL: https://github.com/python/cpython/issues/130168
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pyrepl messed up terminal if a signal handler expects stdin","articleBody":"# Bug report\n\n### Bug description:\n\nThis is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though)\n\nStart REPL from a terminal and do\n```\nimport signal\nsignal.signal(signal.SIGINT, lambda s, f: input(\"test\"))\n\u003cCtrl+C\u003e\n```\n\nYour terminal is messed up and newline won't work anymore. (Not the Python repl which will exit due to some run time error, the terminal itself is messed up)\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-138617\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/gaogaotiantian","@type":"Person","name":"gaogaotiantian"},"datePublished":"2025-02-16T02:02:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/130168/cpython/issues/130168"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d2d08cab-103e-17f8-f834-51b76cbbd57b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92BE:28C211:29E684:39203F:6A513F71 |
| html-safe-nonce | 16881b7876a0a40fd644f9c7df343db0e33aa1611dd3e8b5c8f17bfd0dbecc35 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkJFOjI4QzIxMToyOUU2ODQ6MzkyMDNGOjZBNTEzRjcxIiwidmlzaXRvcl9pZCI6IjQ5NTQxNjAyNjg4MTY3MTAyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4b3858fffc202fced141ec0ae2f85b765ce3479992cf2b20046ca98da3170e26 |
| hovercard-subject-tag | issue:2855822552 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/130168/issue_layout |
| twitter:image | https://opengraph.githubassets.com/03a5acd5259c252f58a7e957c9c95844bb9e189ae6803fc7e6b260786c88a6a5/python/cpython/issues/130168 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/03a5acd5259c252f58a7e957c9c95844bb9e189ae6803fc7e6b260786c88a6a5/python/cpython/issues/130168 |
| og:image:alt | Bug report Bug description: This is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though) Start REPL from a terminal and do import signal signal.sig... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gaogaotiantian |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e876f00c5723f6080b9d294e4958fd4d506e6faf |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width