Title: curses "insstr" does not handle newline properly on Mac OS · Issue #107267 · python/cpython · GitHub
Open Graph Title: curses "insstr" does not handle newline properly on Mac OS · Issue #107267 · python/cpython
X Title: curses "insstr" does not handle newline properly on Mac OS · Issue #107267 · python/cpython
Description: Bug report import curses def bug(scr): scr.addstr("first line\n") scr.addstr("second line") scr.refresh() scr.getch() scr.insstr(0, 5, "X\nXX") scr.refresh() scr.getch() curses.wrapper(bug) Using Python 3.11.3 and 3.11.4 on Apple M2 Mac ...
Open Graph Description: Bug report import curses def bug(scr): scr.addstr("first line\n") scr.addstr("second line") scr.refresh() scr.getch() scr.insstr(0, 5, "X\nXX") scr.refresh() scr.getch() curses.wrapper(bug) Using P...
X Description: Bug report import curses def bug(scr): scr.addstr("first line\n") scr.addstr("second line") scr.refresh() scr.getch() scr.insstr(0, 5, "X\nXX") scr.refresh() scr.getch...
Opengraph URL: https://github.com/python/cpython/issues/107267
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"curses \"insstr\" does not handle newline properly on Mac OS","articleBody":"\u003c!--\r\n If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not\r\n the right place to seek help. Consider the following options instead:\r\n\r\n - reading the Python tutorial: https://docs.python.org/3/tutorial/\r\n - posting in the \"Users\" category on discuss.python.org: https://discuss.python.org/c/users/7\r\n - emailing the Python-list mailing list: https://mail.python.org/mailman/listinfo/python-list\r\n - searching our issue tracker (https://github.com/python/cpython/issues) to see if\r\n your problem has already been reported\r\n--\u003e\r\n\r\n# Bug report\r\n\r\n```\r\nimport curses\r\n\r\ndef bug(scr):\r\n scr.addstr(\"first line\\n\")\r\n scr.addstr(\"second line\")\r\n scr.refresh()\r\n scr.getch()\r\n scr.insstr(0, 5, \"X\\nXX\")\r\n scr.refresh()\r\n scr.getch()\r\n\r\ncurses.wrapper(bug)\r\n```\r\n\r\nUsing Python 3.11.3 and 3.11.4 on Apple M2 Mac (Mac OS Ventura 13.4, iTerm and Terminal.app), Python 3.10.6 on Intel Mac (Mac OS Monterey 12.6, iTerm) produce:\r\n\u003cimg width=\"185\" alt=\"python_curses_bug_maxos\" src=\"https://github.com/python/cpython/assets/37314996/d5f9470d-dc54-49f3-a0c0-dba8642935ba\"\u003e\r\n\r\nPython 3.11.2 on Intel Ubuntu 22.04 (in GNOME terminal) produces correct behavior. An equivalent C program using ncurses directly on the above Macs (in the same terminal) also produces correct behavior. \r\n\r\n\r\n\r\n\u003c!--\r\nYou can freely edit this text. Remove any lines you believe are unnecessary.\r\n--\u003e\r\n","author":{"url":"https://github.com/yzhanglbto","@type":"Person","name":"yzhanglbto"},"datePublished":"2023-07-25T20:27:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/107267/cpython/issues/107267"}
| 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:4e470677-db77-5376-a94c-ab1f2ad91b87 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B082:1EFC6:1671B81:1ED6BFF:696AA8D9 |
| html-safe-nonce | 58b9f9aed7660fb784b2d5e0f4a6497d876e8f344f2c6d092d3a71798f6c27a9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDgyOjFFRkM2OjE2NzFCODE6MUVENkJGRjo2OTZBQThEOSIsInZpc2l0b3JfaWQiOiI2MTg4NDQxNDU1OTg3MTczNTkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 735fda85cf55fe81f79fc9e08453c54d6539a0482876afe1917a8cff3562b800 |
| hovercard-subject-tag | issue:1821094838 |
| 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/107267/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82c7eadd9a566886fd07782fe7df1008cc018228ad5cf72cf8c41f6296fe8c30/python/cpython/issues/107267 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82c7eadd9a566886fd07782fe7df1008cc018228ad5cf72cf8c41f6296fe8c30/python/cpython/issues/107267 |
| og:image:alt | Bug report import curses def bug(scr): scr.addstr("first line\n") scr.addstr("second line") scr.refresh() scr.getch() scr.insstr(0, 5, "X\nXX") scr.refresh() scr.getch() curses.wrapper(bug) Using P... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yzhanglbto |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9 |
| 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 | dd9a979046e6382bd084e2bd873bf65f797125ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width