Skip to content

shell integration breaks repl tracebacks #25479

Closed as not planned
Closed as not planned

Description

@190n

Type: Bug

Behaviour

with shell integration enabled, if i cause an exception in the repl the traceback points to an "import platform" line instead of the actual error

Steps to reproduce:

  1. ensure "python > terminal > shell integration" is enabled in settings
  2. open a shell and then a python repl
  3. run something like raise 5
Python 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> raise 5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    import platform
    ^^^^^^^
TypeError: exceptions must derive from BaseException

Diagnostic data

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

2025-09-20 13:20:35.434 [info] Telemetry is disabled
2025-09-20 13:20:35.434 [info] Experiments are disabled, only manually opted experiments are active.
2025-09-20 13:20:35.434 [warning] Dir "/home/me/project/.pixi/envs" is not watchable (directory does not exist)
2025-09-20 13:20:35.441 [info] Python interpreter path: /bin/python
2025-09-20 13:20:35.518 [info] > pyenv which python
2025-09-20 13:20:35.518 [info] cwd: .
2025-09-20 13:20:45.181 [info] Pylance extension is not installed.
2025-09-21 21:50:36.054 [info] Discover tests for workspace name: undefined - uri: /home/me/.config/Code/User/settings.json

Extension version: 2025.14.0
VS Code version: Code 1.104.0 (f220831ea2d946c0dcb0f3eaa480eb435a2c1260, 2025-09-10T06:46:18.035Z)
OS version: Linux x64 6.16.7-200.fc42.x86_64
Modes:

Activity

  1. ddxv commented on Oct 10, 2025

    @ddxv

    190n Thank you for pinpointing what caused this. I was able to resolve the issue by disabling "Shell Integration (Preview)" and can now see tracebacks again.

  2. added
    bugIssue identified by VS Code Team member as probable bug
    and removed
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on Oct 17, 2025
  3. anthonykim1 commented on Oct 17, 2025

    @anthonykim1

    Can't seem to repro this. Do 190n you see the same in REPL outside of VS Code.

  4. github-actions commented on Nov 17, 2025

    @github-actions

    Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

    Happy Coding!

  5. saleemrashid commented on Jan 24, 2026

    @saleemrashid

    If anyone else is seeing this, it's python/cpython#137576, because the shell integration sets PYTHON_BASIC_REPL=1 and PYTHONSTARTUP to https://github.com/microsoft/vscode-python/blob/main/python_files/pythonrc.py, which causes this behavior. It's fixed in Python 3.14.

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

Metadata

Metadata

Labels

area-replinfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions