Skip to content

Run selection/line in python terminal seems to fail if selected too many characters#25741

@alexanderpils

Description

@alexanderpils

Type: Bug

Behaviour

On my MacBook when I select more than around 1100 characters the parsing of the selection is failing and causing then an syntax error when executed in the terminal.

Steps to reproduce:

  1. Select more than 1100 characters with some indentations like functions, classes, loops,...

  2. Then press shift + enter (Python: Run selection/Line in Python Terminal)

  3. Now the data gets parsed wrong and is causing an Error.

screenrecording.mov

Diagnostic data

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

XXX 

Extension version: 2026.0.0
VS Code version: Code 1.108.1 (Universal) (585eba7c0c34fd6b30faac7c62a42050bfbc0086, 2026-01-14T14:55:44.241Z)
OS version: Darwin arm64 25.2.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings

 languageServer: "Pylance" 

Installed Extensions
Extension NameExtension IdVersion
autodocstringnjp0.6.1
copilot-chatGit0.36.1
debugpyms-2025.18.0
echoapi-for-vscodeEch1.7.13
gitlenseam17.9.0
isortms-2025.0.0
js-debugms-1.105.0
js-debug-companionms-1.1.3
jupyterms-2025.9.1
jupyter-keymapms-1.1.2
jupyter-renderersms-1.3.0
LiveServerrit5.7.9
material-icon-themePKi5.30.0
pythonms-2026.0.0
rainbow-csvmec3.24.1
ruffcha2026.34.0
vscode-js-profile-tablems-1.0.10
vscode-jupyter-cell-tagsms-0.1.9
vscode-jupyter-slideshowms-0.1.6
vscode-pylancems-2025.10.4
vscode-python-envsms-1.16.0
vslivesharems-1.0.5959
vsliveshare-packms-0.4.0
System Info
ItemValue
CPUsApple M1 Pro (8 x 2400)
GPU Status2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg)2, 3, 4
Memory (System)16.00GB (0.36GB free)
Process Argv--crash-reporter-id 6c7f7e46-e60f-4b2b-9859-c46c2fc707c1
Screen Readerno
VM0%
A/B Experiments
vsliv368cf:30146710 pythonvspyt551cf:31249601 binariesv615:30325510 nativeloc1:31344060 dwcopilot:31170013 dwoutputs:31242946 copilot_t_ci:31333650 e5gg6876:31282496 pythonrdcb7:31342333 6518g693:31436602 aj953862:31281341 63221493:31336333 cloudbuttont:31379625 42190218_ostrepl:31403339 use-responses-api:31390855 ec5jj548:31422691 cmp-ext-treat:31426748 cp_cls_c_966_ss:31446431 c0683394:31419495 nes-autoexp-off:31446584 a5gib710:31434435 rename_enabled:31436409 7a04d226_do_not_restore_last_panel_session:31438103 anthropic_thinking_t:31432745 cp_cls_c_1081:31443829 copilot-nes-oct-trt:31432596 nes-jump-on-with-edit:31447383 nes-slash-models-on:31441832 nes-set-to-on:31441941 a43f0576c:31442824 ts_provider_disabled:31446105 nes-conv-1-2:31447851 

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions