Cursor terminal cannot handle Python comment with special characters

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In a Python script there exists the following comment that shows the structure of an intermediate Polars data frame.

print('a')
# ┌──────────┬──────┬────────┬─────────────────┬────────────────────┬────────┐
# │ aaaaaaaa ┆ bbb  ┆ cccccc ┆ ddddddddddddddd ┆ eeeeeeeeeeeee      ┆ ffffff │
# │ ---      ┆ ---  ┆ ---    ┆ ---             ┆ ---                ┆ ---    │
# │ i32      ┆ i32  ┆ i32    ┆ u32             ┆ list[i32]          ┆ i64    │
# ╞══════════╪══════╪════════╪═════════════════╪════════════════════╪════════╡
# │ 4        ┆ 5911 ┆ 0      ┆ 61373           ┆ [0, 1, … 95944]    ┆ 0      │
# │ 7        ┆ 5911 ┆ 0      ┆ 61373           ┆ [0, 1, … 95944]    ┆ 1      │
# │ 7        ┆ 5711 ┆ 0      ┆ 58129           ┆ [0, 2, … 95943]    ┆ 2      │
print('b')

For debugging purposes, I often select a block of code and send it (Shift+Enter or simple copy+paste) to Python terminal in Cursor and execute. This has been working fine until I updated Cursor version to the latest 2.6.20 . The issue already existed in a few versions earlier than 2.6.20 but previously I chose to rollback the updates.

Symptom: The Python terminal in Cursor will hang and die if I Shift+Enter or copy+paste the above code block into the terminal. Nothing goes wrong if I do this to a native terminal on my macbook.

AI says it’s due to complex unicode box-drawing characters and gave a number of suggestions that ultimately didn’t work.

I want to keep Cursor updates and Python comments like the above, while still have the freedom of fiddling code like I used to. Is there a valid solution? Thanks!

Python version: 3.13.7 or 3.14.3

Some new development: With Python 3.14.3, it somehow prompted the following error

Python 3.14.3 (v3.14.3:323c59a5e34, Feb  3 2026, 11:41:37) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/readline.py", line 395, in multiline_input
    return reader.readline()
           ~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/reader.py", line 758, in readline
    self.handle1()
    ~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/reader.py", line 741, in handle1
    self.do_cmd(cmd)
    ~~~~~~~~~~~^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/reader.py", line 666, in do_cmd
    command.do()
    ~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/commands.py", line 497, in do
    ev = self.reader.console.getpending()
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pyrepl/unix_console.py", line 544, in getpending
    e.data += e2.data
TypeError: can only concatenate str (not "NoneType") to str

Again, this ONLY happens if I use Cursor’s terminal. MacOS’s native terminal is fine.

Steps to Reproduce

Open Cursor, create a Cursor terminal, install Python (e.g. Python3.14), in the cursor terminal type python, the copy and paste the following code

print('a')
# ┌──────────┬──────┬────────┬─────────────────┬────────────────────┬────────┐
# │ aaaaaaaa ┆ bbb  ┆ cccccc ┆ ddddddddddddddd ┆ eeeeeeeeeeeee      ┆ ffffff │
# │ ---      ┆ ---  ┆ ---    ┆ ---             ┆ ---                ┆ ---    │
# │ i32      ┆ i32  ┆ i32    ┆ u32             ┆ list[i32]          ┆ i64    │
# ╞══════════╪══════╪════════╪═════════════════╪════════════════════╪════════╡
# │ 4        ┆ 5911 ┆ 0      ┆ 61373           ┆ [0, 1, … 95944]    ┆ 0      │
# │ 7        ┆ 5911 ┆ 0      ┆ 61373           ┆ [0, 1, … 95944]    ┆ 1      │
# │ 7        ┆ 5711 ┆ 0      ┆ 58129           ┆ [0, 2, … 95943]    ┆ 2      │
print('b')

into the terminal.

Expected Behavior

The terminal hangs.

Operating System

MacOS

Version Information

Version: 2.6.20
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Hi Charlie!

This is a known bug in Cursor’s integrated terminal. When pasting text that exceeds ~1018 bytes (which your Polars DataFrame box-drawing characters easily reach due to their multi-byte UTF-8 encoding), the terminal’s PTY layer silently drops data. This causes the hang you’re seeing, and also explains the Python 3.14.3 TypeError – that error surfaces because the data corruption at the terminal layer causes getpending() to return None for partial events.

The root cause is an outdated dependency in Cursor’s terminal stack. The fix is tracked and the team is aware, but there’s no ETA I can share at this time.

Workaround: For now, you can write the code to a file and run it from the terminal (python script.py) instead of pasting directly into the Python REPL.

You may also find these related threads helpful:

Thank you Mohit.

“exceeds ~1018 bytes“ - so I removed the UTF-8 comments, and copied and pasted a block of code that clearly contains more than 1018 bytes of code, and it did work. What does “1018 bytes” mean? Is it the upper bound of characters in ONE line of code?

The ~1018 limit is based on bytes, not characters. Unicode box-drawing symbols like ┌, ─, and ╞ take 3 bytes each in UTF-8, so a line that appears ~80 characters wide can easily exceed 200 bytes. In contrast, ASCII characters use just 1 byte each, which is why your ASCII version stayed comfortably within the limit.