Skip to content

Disable PyREPL for >= 3.13 #25164

Closed

Description

Addressing concerns from: #24256 and enter issues such as #25043

We can enable Python shell integration, and allow user to use lsp completion for Python REPL, for those using Python > 3.13 if we disable PyREPL for users before the actual fix.

We would disable PyREPL by exporting PYTHON_BASIC_REPL=1 in user's environment variable collection.
Then we would allow Python shell integration for people with Python > 3.13.

We should also eventually make Python shell integration enabled as default true.

With this we would be able to shell integration enable for >= 3.13 safe from cpython upstream fix to adjust terminal cursor to correct place; python/cpython#126131

Activity

  1. changed the title [-]Disable PyREPL for > 3.13[/-] [+]Disable PyREPL for >= 3.13[/+] on Jun 27, 2025
  2. cbrnr commented on Jul 11, 2025

    @cbrnr

    Not sure if I'm missing something, but I still get indentation errors with the latest 1.102.0 release (Python Extension is 2025.10.0):

    Python 3.13.5 (main, Jun 12 2025, 12:22:43) [Clang 20.1.4 ] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> def f(x):
    ...         if x < 0:
    ...                         return x - 1
    ...                             elif x == 0:
    ...                                             return 0
    ...                                                 else:
    ...                                                                 return x + 1
    ...                                                                 
      File "<python-input-0>", line 4
        elif x == 0:
    IndentationError: unexpected indent
    

    This is on running the following code with ShiftEnter:

    def f(x):
        if x < 0:
            return x - 1
        elif x == 0:
            return 0
        else:
            return x + 1
    
    print(f(5))
  3. ptoche commented on Jul 13, 2025

    @ptoche

    Not sure if this is the same issue I experienced, but I had a similar indentation error message because the file contained an error multiple lines below the code being executed. I also had a message to disable "smart send"...

  4. johnslavik commented on Jul 16, 2025

    @johnslavik

    Is there a way to unset the disablement without having to unset PYTHON_BASIC_REPL?
    I don't rely on the run in console feature but I do rely on the new REPL a lot.

  5. anthonykim1 commented on Jul 17, 2025

    @anthonykim1
    Author

    Sorry about this Clemens Brunner (@cbrnr) I confirmed the regression filed issue: #25295
    Will work to get this solved in the next point release and will let you know once the fix is out for pre-release.

    Patrick Toche (@ptoche) That issue would probably bc you had old python code (such from python2) or syntactically wrong Python code that you were trying to execute with smart send.

    Bartosz Sławecki (@bswck) Yes! Trying to make a setting for this related to shell integration #25240

  6. anthonykim1 commented on Jul 18, 2025

    @anthonykim1
    Author

    Hi all, I've put out a fix in the pre-release version of Python extension. Please try out vscode-insiders python pre-release version.

    Turning off python shell integration would disable PyREPL and turning on python shell integration would allow PyREPL.
    Make sure to restart extension, give it a proper reload before testing!

    Thanks

  7. ptoche commented on Aug 27, 2025

    @ptoche

    @ptoche That issue would probably bc you had old python code (such from python2) or syntactically wrong Python code that you were trying to execute with smart send.

    as you type code, it is syntactically incorrect for at least a few minutes.

    My solution was to ditch vscode, at least temporarily...

  8. anthonykim1 commented on Oct 1, 2025

    @anthonykim1
    Author

    To re-enable PyREPL, you can turn off python.terminal.shellIntegration.enabled to be false.
    python/cpython#126131 leads to weird cursor issue in VS Code, hence such a bold move atm.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions