question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shift-enter causes comically slow code-send to terminal

See original GitHub issue

Environment data

  • VS Code version: 1.48.0
  • Extension version (available under the Extensions sidebar): 2020.8.101144
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.6 64-bit (‘base’: conda)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: Pylance

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

When I press shift-enter, code is sent to the terminal lickety split.

Actual behaviour

We’re partying like it’s 1989, with 1200 baud modems: 2020-08-18_18-47-43

Steps to reproduce:

  1. Write a long line of code.
  2. With the cursor in the long line of code you just wrote, press shift-enter.
  3. Have a sad, like sad cat, while waiting on the code to get to the terminal window.

image

Logs

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

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaacf'
> conda --version
> pyenv root
> python3.7 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Starting Pylance language server.
Error 2020-08-18 18:27:46: Detection of Python Interpreter for Command py and args -3.6 failed as file Python 3.6 not found!

 -3.8-32
 -3.7-64 does not exist
Error 2020-08-18 18:27:46: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

 -3.8-32
 -3.7-64 does not exist
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\Scripts\conda.exe info --json
Python interpreter path: ~\Anaconda3\python.exe
> ~\Anaconda3\Scripts\conda.exe env list
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\Scripts\conda.exe env list
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py jupyter kernelspec --version
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "import urllib.request, json, smtplib, ssl"
> ~\Anaconda3\Scripts\conda.exe info --json
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py pip --version
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "import urllib.request, json, smtplib, ssl"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "from email.mime.text import MIMEText"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "from email.mime.multipart import MIMEMultipart"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py campsite_url = "https://www.recreation.gov/api/camps/availability/campground/234685/month?start_date=2020-08-01T00%3A00%3A00.000Z"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "url = urllib.request.urlopen(campsite_url)"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "campsites = json.loads(url.read().decode())"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py asdasda
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "url = urllib.request.urlopen(campsite_url)
campsites = json.loads(url.read().decode())
asdasda
asdas
"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py sender_email = "aren@arencambre.com"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py receiver_email = "novasource@gmail.com"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py password = "[nice try; I removed it]"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py email_subject = ""
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "message = MIMEMultipart("alternative")"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "message["From"] = sender_email"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "message["To"] = receiver_email"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "email_body_html = ''"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "email_body_plain = ''"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "not_available_strings = ['Reserved', 'Not Available']"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py "for key in campsites['campsites']:
    if(campsites['campsites'][key]['availabilities']['2020-08-29T00:00:00Z'] not in not_available_strings and
       campsites['campsites'][key]['availabilities']['2020-08-30T00:00:00Z'] not in not_available_strings):
        email_body_html += '<p>Found a campsite! <a href="https://www.recreation.gov/camping/campsites/' + str(key) + '">check this</a></p>\n'
        email_body_plain += 'site' + key + ' has availability '
        email_subject = "Campsite check: CAMPSITE FOUND"
"
> ~\Anaconda3\python.exe c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\pyvsc-run-isolated.py c:\Users\[username]\.vscode\extensions\ms-python.python-2020.8.101144\pythonFiles\normalizeForInterpreter.py for key in campsites['campsites']:
    if(campsites['campsites'][key]['availabilities']['2020-08-29T00:00:00Z'] not in not_available_strings and
       campsites['campsites'][key]['availabilities']['2020-08-30T00:00:00Z'] not in not_available_strings):
        email_body_html += '<p>Found a campsite! <a href="https://www.recreation.gov/camping/campsites/' + str(key) + '">check this</a></p>\n'
        email_body_plain += 'site' + key + ' has availability '
        email_subject = "Campsite check: CAMPSITE FOUND"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
meganroggecommented, Dec 12, 2020

resolved @arencambre

1reaction
arencambrecommented, Dec 12, 2020

It is reported as microsoft/vscode#112346, then it got closed as being a duplicate of itself. 🤣

Read more comments on GitHub >

github_iconTop Results From Across the Web

Screen + vim causes shift-enter to insert 'M' and a newline
Some terminal app (KTerminal, Gnome terminal, virtual console etc) ... do a “cat -v”, press Shift-Enter, then Enter, then Ctrl - D and...
Read more >
Shift-Enter导致可笑的慢速码- 发送到终端:Shift-enter causes ...
Shift-enter causes comically slow code-send to terminal 环境数据VS Code version: 1.48.0 Extension version (available under the Extensions sidebar): 2020.8.
Read more >
when memory allocator is Async, swapping lobbies on some servers ...
when memory allocator is Async, swapping lobbies on some servers makes the world not load right. ... Shift-enter causes comically slow code-send to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found