-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Environment data
- VS Code version: 1.45.1 (user setup)
- Extension version (available under the Extensions sidebar): Version: 1.45.1 (user setup)
- OS and version: Windows_NT x64 10.0.18363
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.3 32 2020.5.80290
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: NA
- Relevant/affected Python-related VS Code extensions and their versions: ms-python.python
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): false - Value of the
python.languageServer
setting: 0.5.45.0
Expected behaviour
When selecting some lines codes and pressing the keyboard F9 (as default) for running selection line in the python terminal it was expected to run the selected lines in the python terminal.
Actual behaviour
Hey! I would like to please ask for some help. Thanks!
When selecting some lines codes and pressing the F9 as default for running selection line in the python terminal no actions happened, however pressing the same command manually yes.
Therefore i have tried to change the shortcut to ctrl + enter (accodring to #1349)
also eliminating any duplicate shortcut,however still no action was performed.
Steps to reproduce:
select code
press keyboard shortcut recognized as running selection/lines in python terminal (tried using the f9 and also changing the keyboard to ctrl+enter.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
settings.json file as below
``
`{
"workbench.colorTheme": "Visual Studio Dark",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.codeLens.enabled": false,
"python.jediEnabled": false,
"files.autoSave": "afterDelay",
"python.dataScience.sendSelectionToInteractiveWindow": true,
"window.zoomLevel": 0,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"editor.minimap.enabled": false,
// DK modification
"code-runner.executorMap": {
“python”: “C:\Users\debor\AppData\Local\Programs\Python\Python38\python.exe”
}``
</p>
</details>
<br />
<details>
<summary>
Output from <code>Console</code> under the <code>Developer Tools</code> panel (toggle Developer Tools on under <code>Help</code>; turn on source maps to make any tracebacks be useful by running <code>Enable source map support for extension debugging</code>)
</summary>
<p>
XXXX
</p>
</details>
Activity
luabud commentedon Jun 1, 2020
Hey @DTKx! The default shortcut for running selections/lines is Shift + Enter, not Ctrl + Enter.
You may be able to to configure it to F9 by adding the following content to your
keybindings.json
file (View > Command Palette... and run "Preferences: Open Keyboard Shortcuts (JSON)"You'll know if it was successfully updated if you open a Python file and right click on the editor, then look for the "Run Selection/Line in Python Terminal" command. The new shortcut will appear right next to it:


Would you mind pasting here a screenshot of what it shows next to this command for you?
DTKx commentedon Jun 2, 2020
Hello @luabud !

Thanks you for the detailed answer.
Sorry i guess I did not explain well, here is a print:
Therefore, I knew i the modification was acknowledged, however when I hit the keyboard shortcut mentioned in the options the command run selection is not performed.
In order to perform the run selection all the time i need to open up the options scrolll down to run selection in the menu and press enter (manually).
I have checked the json file and I found two duplicates for the execSelection
So I commented one to test and still the keyboard shortcut did not work.
To try again, I modified the shortcut to f9 and tested, but still no answer.
Moreover, I am not sure if this would help, but i have tried to reinstall visual studio, however it did not uninstalled completellly, I wonder if a complete uninstall could fix this issue for the moment, i also checked and I did not found a documentation on how to completelly uninstall VS.
Any potential clue is welcomed :)
Thanks
luabud commentedon Jun 9, 2020
Thanks for the info, @DTKx! Since the shortcuts aren't triggering anything, I believe the issue would be in VS Code and not the Python extension. A reinstall might help indeed.
You raised a good point, it isn't documented how to completely uninstall VS Code. I'll open an issue on our docs repo, but in the mean time this could help: https://superuser.com/questions/1380208/how-to-completely-uninstall-visual-studio-code-from-windows-10.
I'm closing the issue since there's no action item on the Python extension. Let me know how the reinstall goes, I hope it works!