Skip to content

Add link to native REPL information - #26134

Merged
Eduardo Villalpando Mello (edvilme) merged 7 commits into
mainfrom
pyrepl-link
Sep 2, 2026
Merged

Add link to native REPL information#26134
Eduardo Villalpando Mello (edvilme) merged 7 commits into
mainfrom
pyrepl-link

Conversation

@edvilme

Copy link
Copy Markdown

Fixes #24754

image

This pull request refactors how shell integration sequences are managed in python_files/pythonrc.py by introducing a dedicated ShellIntegrationSequence enum, and updates related string formatting to use this enum. It also updates user-facing messages in both the Python startup script and the VS Code terminal link provider to include a documentation URL. These changes improve maintainability, clarity, and user guidance.

Shell integration refactoring:

  • Introduced the ShellIntegrationSequence enum to centralize shell integration control sequences, replacing hard-coded string literals throughout the code. [1] [2]
  • Refactored the __str__ method in the prompt class to use the new enum values, improving readability and reducing duplication.

User guidance improvements:

  • Updated the printed startup message in pythonrc.py to include a documentation URL, guiding users to more information about the VS Code Native REPL.
  • Updated the expected link text in pythonStartupLinkProvider.ts to match the new message format (excluding the URL), ensuring the link detection logic remains consistent with the Python script output.

@edvilme Eduardo Villalpando Mello (edvilme) changed the title Pyrepl link Add link to native REPL information Aug 31, 2026
@bschnurr

Bill Schnurr (bschnurr) commented Aug 31, 2026

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@bschnurr

Copy link
Copy Markdown
Member

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Result: could-not-verify

Summary: Verification could not run because no trusted sandbox image is configured for `microsoft/vscode-python`, and local execution was not authorized. The PR modifies existing Python and TypeScript tests but adds no new test cases. Linux startup-message behavior lacks coverage because the non-Darwin print test is restricted to Windows.

Test runs: 1 not run

  • ⚠️ Not run | Dependency and test discovery preflight | git status --short && git branch --show-current && git diff --name-status upstream/main...HEAD && git diff --unified=0 upstream/main...HEAD -- python_files/tests/test_shell_integration.py src/test/terminals/shellIntegration/pythonStartup.test.ts && echo AUTOMATION_SANDBOX_PROFILE=$AUTOMATION_SANDBOX_PROFILE && if [ -d node_modules ]; then echo node_modules=present; else echo node_modules=missing; fi && python --version && node --version && npm --version
⚠️ Dependency and test discovery preflight diagnostic output
Container verification could not start: no trusted sandbox image is configured for microsoft/vscode-python. Local execution was not authorized for this PR HEAD.

@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 1, 2026
@anthonykim1

Copy link
Copy Markdown

Eduardo Villalpando Mello (@edvilme) This is cool - fan of getting people to know what we mean by VS Code Native REPL.
If we were to do this - we should also get this into settings description: python.REPL.sendToNativeREPL

@anthonykim1

Copy link
Copy Markdown

Looking at the missing decoration marker for shell integration.. I wish we had python/cpython#144724 so we can enable shell integration on windows. aka. make:
python.terminal.shellIntegration.enabled unified with terminal.integrated.shellIntegration.enabled this would allow user to give context of the terminal into chat directly.

@edvilme

Copy link
Copy Markdown
Author

Eduardo Villalpando Mello (Eduardo Villalpando Mello (@edvilme)) This is cool - fan of getting people to know what we mean by VS Code Native REPL. If we were to do this - we should also get this into settings description: python.REPL.sendToNativeREPL

Addressed in 516fea5

@edvilme

Copy link
Copy Markdown
Author

Looking at the missing decoration marker for shell integration.. I wish we had python/cpython#144724 so we can enable shell integration on windows. aka. make: python.terminal.shellIntegration.enabled unified with terminal.integrated.shellIntegration.enabled this would allow user to give context of the terminal into chat directly.

Yes, I agree. Will try to get updates on that, as it would greatly improve the overall experience for users

@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 0f3ddf5 into main Sep 2, 2026
90 checks passed
@edvilme

Copy link
Copy Markdown
Author

Adding link for reference: https://aka.ms/python-native-repl

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

Labels

feature-request Request for new features or functionality review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed Native REPL description link in the terminal

3 participants