vscode-python: Run Selection/Line in python terminal broken after last update

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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 23 (2 by maintainers)

Most upvoted comments

@jsarneja no ETA as we’re busy dealing with a nasty conda + PowerShell issue.

@ChandanVerma @pomoneomarx

Please note the issue has been resolved, if you look above, you can see that a PR was merged yesterday to resolve this, we need to verify the fix, hope you can help with that.

Hi everyone, we’ve created a fix for this, please could you download the development version and help us verify the fix. Install instructions and fix can be downloaded here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

I confirm the issue in windows10. Any idea by when this could be solved?