Run Selection/Line in python terminal broken after last update
See original GitHub issueEnvironment 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:
- Copy the following in a python file:
print(32)
for i in range(4):
print(i)
- Select and run via shift+enter
Logs
Output for Python
in the Output
panel (View
→Output
, 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:23 (2 by maintainers)
Top Results From Across the Web
'Run selection/line in python terminal' stops working after you ...
Issue Type: Bug Repro Use the Run selection/line in python terminal command In the python terminal, run quit() (or ctrl+d) Now try using...
Read more >linux - Run line in Python terminal not working after Run file in ...
Right mouse button --> Run Selection/Line in Interactive Window , this opens an interactive window to run the selected portion of code.
Read more >IDLE — Python 3.11.1 documentation
A request past the end of the file goes to the end. Clear any selection and update the line and column status. Show...
Read more >November 2022 (version 1.74) - Visual Studio Code
The Run Task and Configure Tasks commands appear in the terminal dropdown for increased discoverability and ease of access. The last section of...
Read more >Python console | PyCharm Documentation - JetBrains
With no selection, the command changes to Execute line in console. ... After the code is executed on the Python console, run the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.