Title: Crash when print ANSI escape code to color output text · Issue #915 · bpython/bpython · GitHub
Open Graph Title: Crash when print ANSI escape code to color output text · Issue #915 · bpython/bpython
X Title: Crash when print ANSI escape code to color output text · Issue #915 · bpython/bpython
Description: Tried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the end='' parameter to the print function, it work...
Open Graph Description: Tried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the end='' ...
X Description: Tried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the end...
Opengraph URL: https://github.com/bpython/bpython/issues/915
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash when print ANSI escape code to color output text","articleBody":"Tried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the `end=''` parameter to the `print` function, it works fine; looks like `bpython` was expecting the cursor to advance but only changing the color doesn't do that.\r\n\r\n```\r\n~ % bpython\r\nbpython version 0.21 on top of Python 3.8.2 /Library/Developer/CommandLineTools/usr/bin/python3\r\n>>> print('\\033[91m', end='')\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/arian/Library/Python/3.8/bin/bpython\", line 8, in \u003cmodule>\r\n sys.exit(main())\r\n File \"/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py\", line 201, in main\r\n exit_value = repl.mainloop(True, paste)\r\n File \"/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py\", line 121, in mainloop\r\n self.process_event_and_paint(e)\r\n File \"/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py\", line 95, in process_event_and_paint\r\n array, cursor_pos = self.paint()\r\n File \"/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsiesfrontend/repl.py\", line 1610, in paint\r\n assert cursor_row >= 0 and cursor_column >= 0, (\r\nAssertionError: (-1, 74, 9, 0, 0)\r\n```\r\n","author":{"url":"https://github.com/arian-deimling","@type":"Person","name":"arian-deimling"},"datePublished":"2021-09-25T15:33:30Z","url":"https://github.com/bpython/bpython/issues/915"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:c0a5d0b4-84b9-3c00-5cf7-061fda8da023 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A944:D1D28:15D7E85:1CFA172:6B020122 |
| html-safe-nonce | 435d784a98231d426d5b81f3340fd2d18fc29fd8837a4a06ee2c61f110f28d0b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTQ0OkQxRDI4OjE1RDdFODU6MUNGQTE3Mjo2QjAyMDEyMiIsInZpc2l0b3JfaWQiOiIxNjczMzk4MDY4NjcxODA3Nzc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a207c463cc7385dff74d5e117e6c377af8a333f14e9df7c70e212d1ba10e747d |
| hovercard-subject-tag | issue:1007116972 |
| 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/bpython/bpython/915/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fdba9f5840f75245cc6a87953555582ba2d41e65c6b437d8676cb8e15faf9a3d/bpython/bpython/issues/915 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fdba9f5840f75245cc6a87953555582ba2d41e65c6b437d8676cb8e15faf9a3d/bpython/bpython/issues/915 |
| og:image:alt | Tried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the end='' ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arian-deimling |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width