Title: Python3.13 is mishandling OSC 633 sequences · Issue #126131 · python/cpython · GitHub
Open Graph Title: Python3.13 is mishandling OSC 633 sequences · Issue #126131 · python/cpython
X Title: Python3.13 is mishandling OSC 633 sequences · Issue #126131 · python/cpython
Description: Bug report Bug description: Bug Report Related: #122622 Bug description: VS Code has set of custom escape sequences that allow shell integration. We have a custom pythonrc file that we set equal to user's PYTHONSTARTUP file and effective...
Open Graph Description: Bug report Bug description: Bug Report Related: #122622 Bug description: VS Code has set of custom escape sequences that allow shell integration. We have a custom pythonrc file that we set equal to...
X Description: Bug report Bug description: Bug Report Related: #122622 Bug description: VS Code has set of custom escape sequences that allow shell integration. We have a custom pythonrc file that we set equal to...
Opengraph URL: https://github.com/python/cpython/issues/126131
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python3.13 is mishandling OSC 633 sequences","articleBody":"# Bug report\n\n### Bug description:\n\nBug Report\n-------------------------------------------\n\nRelated: https://github.com/python/cpython/issues/122622\n\n### Bug description: \n\nVS Code has set of [custom escape sequences](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st) that allow shell integration. \n\nWe have a [custom pythonrc file](https://github.com/microsoft/vscode-python/blob/main/python_files/pythonrc.py#L77) that we set equal to user's PYTHONSTARTUP file and effectively override user's sys.ps1(this can be improved once we have the pre-exec hook mentioned in the related PR) This allows us to get features that VS Code shell integration offers.\n\nWith the new REPL that 3.13 offers, we have noticed that the cursor location is wrongly placed whenever REPL from Python3.13 is launched from our terminal. See: \n\u003cimg width=\"986\" alt=\"Screenshot 2024-10-29 at 8 48 48 AM\" src=\"https://github.com/user-attachments/assets/14441c5f-b4aa-4895-9ef1-210e5877a3f6\">\n\n\nAfter investigation we found out it is because Python3.13 is somehow handling our custom sequences such as \n```\ncommand_line=\"\\x1b]633;E;\" + str(get_last_command()) + \"\\x07\",\n```\ninstead of ignoring them as it did in the previous versions of Python. This is what is leads to the wrong cursor location at the end. Removing these sequences brought back the cursor to the \"right\" position in terminal.\n\nCPython should ignore these custom sequences instead of wrongly handling them.\n\n\n\nEdit: Workaround could be temporarily disabling PyREPL via env var injection \nexporting `PYTHON_BASIC_REPL=1`\n \n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nmacOS\n\n### Linked PR\n\ncoming soon (would appreciate advice on where to start digging in but I assume it is somewhere https://github.com/python/cpython/tree/main/Lib/_pyrepl)","author":{"url":"https://github.com/anthonykim1","@type":"Person","name":"anthonykim1"},"datePublished":"2024-10-29T15:49:34Z","url":"https://github.com/python/cpython/issues/126131"}
| 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:cb9b66f6-fc32-b83f-25d9-633a124826c6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A64:81000:8ED43:C7648:6AFDA78C |
| html-safe-nonce | a98577f3971e6ccb1dee0577c763f5960d790c7fa6cdf519d2a2e56644f32d94 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTY0OjgxMDAwOjhFRDQzOkM3NjQ4OjZBRkRBNzhDIiwidmlzaXRvcl9pZCI6IjQxNTY2NTMwNDI4NzI5ODU0ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 117136699eade9254a2a0cd7d912e48c9ecf80252446f3646d6737ae1d043e99 |
| hovercard-subject-tag | issue:2621674155 |
| 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/126131/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5032570569b491d3c6b024a954d7a995421629869cb0679e6d43e6d04650f706/python/cpython/issues/126131 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5032570569b491d3c6b024a954d7a995421629869cb0679e6d43e6d04650f706/python/cpython/issues/126131 |
| og:image:alt | Bug report Bug description: Bug Report Related: #122622 Bug description: VS Code has set of custom escape sequences that allow shell integration. We have a custom pythonrc file that we set equal to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anthonykim1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| 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 | 0ddf53eb35c87f1f8df13dbf75c3bdadbfc6e969 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width