PyREPL: Correctly handle OSC codes - #26175
Eduardo Villalpando Mello (edvilme) wants to merge 17 commits into
Conversation
Import _pyrepl conditionally Import _pyrepl conditionally
2c66f29 to
05e8365
Compare
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
| @@ -24,7 +24,7 @@ def test_decoration_success(): | |||
| importlib.reload(pythonrc) | |||
| if sys.platform != "win32" and (not is_wsl): | |||
There was a problem hiding this comment.
Warning · Non-blocking recommendation
📍 python_files/tests/test_shell_integration.py:25
The test still skips all Windows environments even though production now installs this prompt on Windows with Python 3.13+. Add coverage using the production platform/version condition, plus focused cases proving the replacement regex removes both BEL- and ST-terminated OSC sequences while preserving CSI handling.
[verified]
|
Result: 🔴 Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Could not prepare offline npm dependencies: Could not download fdir from the Microsoft package feed (HTTP 502). Test runs: none recorded. |
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
| @@ -23,36 +30,54 @@ def _initialize(): | |||
| _bool = bool | |||
| _str = str | |||
There was a problem hiding this comment.
Info · Optional note
📍 python_files/pythonrc.py:31
_str is no longer referenced after command_line began formatting its argument directly; remove this stale captured builtin.
[verified]
|
Result: 🔴 Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Could not prepare offline npm dependencies: Could not download braces from the Microsoft package feed (HTTP 503). Test runs: none recorded. |
Related python/cpython#157932
Related #25467
Modifies
_pyrepl.utils.ANSI_ESCAPE_SEQUENCEto correctly support VSCode's OSC sequences and prevent cursor misplacing when using the REPL inside vscode.Refactorings for easier maintainability