Skip to content

PyREPL: Correctly handle OSC codes - #26175

Open
Eduardo Villalpando Mello (edvilme) wants to merge 17 commits into
mainfrom
pyrepl-pythonrc-format
Open

Eduardo Villalpando Mello (edvilme) wants to merge 17 commits into
mainfrom
pyrepl-pythonrc-format

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Sep 29, 2026 •

Copy link
Copy Markdown

Related python/cpython#157932
Related #25467

Modifies _pyrepl.utils.ANSI_ESCAPE_SEQUENCE to correctly support VSCode's OSC sequences and prevent cursor misplacing when using the REPL inside vscode.

Refactorings for easier maintainability

@edvilme Eduardo Villalpando Mello (edvilme) added the bug Issue identified by VS Code Team member as probable bug label Sep 29, 2026
@bschnurr

Bill Schnurr (bschnurr) commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

🔒 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):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: 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.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Sep 30, 2026
Comment thread python_files/pythonrc.py
@@ -23,36 +30,54 @@ def _initialize():
_bool = bool
_str = str

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants