Send line in Python3.14 for more than one line not working

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Using send line for more than a single line causes errors:

For example, in this I selected two lines:

import datetime
import time

And using Ctrl+Enter I send line to the open REPL in the terminal below:

  File "<stdin>", line 1
    import datetime
                   ^
SyntaxError: multiple statements found while compiling a single statement

This is likely specific to Python3.14 (the latest) as it has introduced a new fancier REPL. This can be bypassed by setting PYTHON_BASIC_REPL=1 as a user, and I believe is similar to how VSCode handles it. These issues have popped up in the most recent two versions Python3.13 and Python3.14 and just recently cursor started having trouble.

I think that likely the best thing to do is use PYTHON_BASIC_REPL

Steps to Reproduce

Send more than one line to a terminal with the Python REPL open

Expected Behavior

More than one line has a new line after each line.

Operating System

Linux

Version Information

Version: 2.5.26
VSCode Version: 1.105.1
Commit: 7d96c2a03bb088ad367615e9da1a3fe20fbbc6a0
Date: 2026-02-26T04:57:56.825Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Linux x64 6.17.0-14-generic

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the detailed report and diagnosis. You’re spot on.

Python 3.13+ introduced a new interactive REPL that doesn’t handle pasted multi-line input the same way as the classic one. This is mainly a Python extension issue, not something specific to Cursor.

As a workaround, you can set the PYTHON_BASIC_REPL=1 environment variable. This forces the classic REPL, which handles multi-line sends correctly. You can do this a couple of ways:

  • Add it to your shell profile (~/.bashrc, ~/.zshrc, etc.): export PYTHON_BASIC_REPL=1
  • Or add it to your Cursor settings via terminal.integrated.env.linux:
"terminal.integrated.env.linux": {
    "PYTHON_BASIC_REPL": "1"
}

I’ve flagged this with the team. The Python extension should ideally handle this automatically, like VS Code has started doing, but for now this env var workaround should unblock you.

Let me know if that helps.

Hello Dean, I have already had it set in ~/bashrc (possibly that’s why VSCode works, I forget exactly, I know there’s been much back and for about this in various issues in vscode python github repo. Unfortunately, this has not resolved the issue, or at least not since I recently bumped to 3.14

I also just added it to user_settings.json

``"terminal.integrated.env.linux": {

"PYTHON_BASIC_REPL": "1"

}``

I tried this after restarting Cursor and still have the same issue with send line.

Some additional context, I think in the past these can be related:

Python.REPL: Send to Native REPL
Python.REPL: Enable REPLSMart Send

are both disabled

If PYTHON_BASIC_REPL=1 is set both in your bashrc and in Cursor settings, but it still doesn’t work, you need to make sure the variable is actually reaching the terminal session.

Can you check a couple of things:

  1. Open the terminal in Cursor and run echo $PYTHON_BASIC_REPL. It should print 1. If it’s empty, the variable isn’t being passed through.

  2. Also start Python and check from inside:

import os
print(os.environ.get("PYTHON_BASIC_REPL"))
  1. Try launching Python with an inline env var to rule out an environment issue:
PYTHON_BASIC_REPL=1 python3.14

If Send Line works after that, it means the variable isn’t making it through Cursor settings.

  1. What version of the Python extension are you using? (Extensions sidebar → Python → version). Cursor uses its own fork (Anysphere Python), so it might not handle PYTHON_BASIC_REPL correctly for 3.14 yet.

Let me know what you get from those checks.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.