Skip to content

Run Selected Text in Active Terminal - Python IndentationError #122069

@parasurama

Description

@parasurama

Issue Type: Bug

I have a python (not ipython) REPL open in the terminal.
When I send selected text to active terminal, I get an indentation error if my function contain empty lines.

def indent_error():
    print("this causes")

    print("indentation error")


>>> def indent_error():
...     print("this causes")
... 
>>>     print("indentation error")
  File "<stdin>", line 1
    print("indentation error")
    ^
IndentationError: unexpected indent
>>> 
def no_indent_error():
    print("this does not cause")
    print("indentation error")

>>> def no_indent_error():
...     print("this does not cause")
...     print("indentation error")
... 
>>> 

VS Code version: Code 1.55.2 (3c4e3df, 2021-04-13T09:39:47.234Z)
OS version: Darwin arm64 20.3.0
Remote OS version: Linux x64 3.10.0-1062.1.1.el7.x86_64

System Info
Item Value
CPUs undefined
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 8.00GB (0.13GB free)
Process Argv --crash-reporter-id 91026c5d-7e3a-4bf3-a262-944b5040404e
Screen Reader no
VM 0%
Item Value
Remote SSH: prasannac7
OS Linux x64 3.10.0-1062.1.1.el7.x86_64
CPUs Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz (8 x 2593)
Memory (System) 31.26GB (17.40GB free)
VM 100%
Extensions (6)
Extension Author (truncated) Version
remote-ssh ms- 0.65.4
latex-workshop Jam 8.17.0
python ms- 2021.4.765268190
vscode-pylance ms- 2021.4.2
jupyter ms- 2021.5.745244803
sync-rsync vsc 0.36.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry914:30276682
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
pythonvsnew554cf:30291488
pythontb:30283811
vspre833:30267464
pythonptprofiler:30281270
vshan820:30276952
pythondataviewer:30285071
vscus158:30286553

Metadata

Metadata

Assignees

Labels

*as-designedDescribed behavior is as designedterminalGeneral terminal issues that don't fall under another label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions