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.
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:
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.
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
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:
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.
Also start Python and check from inside:
import os
print(os.environ.get("PYTHON_BASIC_REPL"))
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.
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.