Skip to content

Run Selection/Line in python terminal broken after last update #2857

@GPhilo

Description

@GPhilo

Environment data

  • VS Code version: 1.28.0
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: Windows 10 1803, x64
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: -

Actual behavior

After the latest update of vscode, trying to execute any python block via shift+Enter appends an extra newline at the end of each line, which breaks execution of loops.

Expected behavior

The code runs in the terminal

Steps to reproduce:

  1. Copy the following in a python file:
print(32)
for i in range(4):
    print(i)
  1. Select and run via shift+enter

Logs

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

>>> for i in range(4):
...
  File "<stdin>", line 2

    ^
IndentationError: expected an indented block
>>>     print(i)
  File "<stdin>", line 1
    print(i)
    ^
IndentationError: unexpected indent
>>>

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
(The following repeats multiple times, console was cleared before running, errors show only on the first run in a new terminal)

bootstrap-window.js:195 [uncaught exception]: TypeError: Cannot read property 'isWrapped' of undefined

c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:205 Uncaught TypeError: Cannot read property 'isWrapped' of undefined
    at Buffer.getWrappedRangeForLine (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:205)
    at BufferStringIterator.next (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:305)
    at Linkifier._linkifyRows (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Linkifier.js:65)
    at c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Linkifier.js:53

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-terminalbugIssue identified by VS Code Team member as probable bugwindows

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions