Title: Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code · Issue #26115 · microsoft/vscode-python · GitHub
Open Graph Title: Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code · Issue #26115 · microsoft/vscode-python
X Title: Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code · Issue #26115 · microsoft/vscode-python
Description: Type: Bug Behaviour Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code Steps to reproduce: Type: print("Hello, World!") Select the above line Right click selectio...
Open Graph Description: Type: Bug Behaviour Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code Steps to reproduce: Type: print("Hello, World!") Se...
X Description: Type: Bug Behaviour Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code Steps to reproduce: Type: print("Hell...
Opengraph URL: https://github.com/microsoft/vscode-python/issues/26115
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code","articleBody":"\nType: \u003cb>Bug\u003c/b>\n\n\u003c!-- Please fill in all XXX markers -->\n# Behaviour\n\nRight click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code\n\n## Steps to reproduce:\n\n- Type: print(\"Hello, World!\")\n- Select the above line\n- Right click selection -> Run Python -> run selection/line in the python terminal\n\nIt opens terminal, but does not execute code\n\nThe workaround is to launch python from the terminal that just openned.\nIt looks like old issue came back: [https://github.com/microsoft/vscode-python/issues/21393](url)\n\n\n\u003c!--\n**After** creating the issue on GitHub, you can add screenshots and GIFs of what is happening. Consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ for GIF creation.\n-->\n\n\u003c!-- **NOTE**: Please do provide logs from Python Output panel. -->\n# Diagnostic data\n\n\u003cdetails>\n\n\u003csummary>Output for \u003ccode>Python\u003c/code> in the \u003ccode>Output\u003c/code> panel (\u003ccode>View\u003c/code>→\u003ccode>Output\u003c/code>, change the drop-down the upper-right of the \u003ccode>Output\u003c/code> panel to \u003ccode>Python\u003c/code>)\n\u003c/summary>\n\n\u003cp>\n\n```\n2026-08-17 11:41:07.742 [info] Environment discovery is managed by the Python Environments extension (ms-python.vscode-python-envs). Check the \"Python Environments\" output channel for environment-specific logs.\n2026-08-17 11:41:07.952 [info] [test-by-project] Activating project-based testing mode\n2026-08-17 11:41:07.952 [info] [test-by-project] Discovering projects for workspace: c:\\Users\\some_user\\My Drive\\Projects\\Kaggle\\Kaggriculture\\Kaggriculture\n2026-08-17 11:41:07.952 [info] Native locator: Refresh started\n2026-08-17 11:41:07.952 [info] [test-by-project] Found 1 total Python projects from API\n2026-08-17 11:41:07.952 [info] [test-by-project] Filtered to 1 projects in workspace\n2026-08-17 11:41:07.952 [info] [test-by-project] Creating adapter for: Kaggriculture at file:///c%3A/Users/some_user/My%20Drive/Projects/Kaggle/Kaggriculture/Kaggriculture\n2026-08-17 11:41:07.962 [info] Native locator: Refresh started\n2026-08-17 11:41:07.966 [info] > conda info --json\n2026-08-17 11:41:08.077 [info] > pyenv which python\n2026-08-17 11:41:08.077 [info] cwd: ~\\My Drive\\Projects\\Kaggle\\Kaggriculture\\Kaggriculture\n2026-08-17 11:41:08.970 [info] [test-by-project] Registered 1 project(s) for c:\\Users\\some_user\\My Drive\\Projects\\Kaggle\\Kaggriculture\\Kaggriculture\n2026-08-17 11:41:08.971 [info] [test-by-project] Activated 1 project(s) for c:\\Users\\some_user\\My Drive\\Projects\\Kaggle\\Kaggriculture\\Kaggriculture\n2026-08-17 11:41:08.971 [info] [test-by-project] Subscribed to Python project changes\n2026-08-17 11:41:09.718 [info] > \"~/My Drive/Projects/Kaggle/Kaggriculture/kenv/Scripts/activate.bat\" && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2026.4.0-win32-x64/python_files/printEnvVariables.py\n2026-08-17 11:41:09.718 [info] shell: commandPrompt\n2026-08-17 11:41:09.723 [info] > \"~/My Drive/Projects/Kaggle/Kaggriculture/kenv/Scripts/activate.bat\" && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2026.4.0-win32-x64/python_files/printEnvVariables.py\n2026-08-17 11:41:09.723 [info] shell: commandPrompt\n2026-08-17 11:41:09.919 [info] Starting Pylance language server.\n2026-08-17 11:41:10.138 [info] Native locator: Refresh finished in 2185 ms\n2026-08-17 11:41:10.139 [info] Active interpreter [c:\\Users\\some_user\\My Drive\\Projects\\Kaggle\\Kaggriculture\\Kaggriculture]: c:\\Users\\some_user\\My Drive\\Projects\\Kaggle\\Kaggriculture\\kenv\\Scripts\\python.exe\n2026-08-17 11:41:14.404 [info] > ~\\AppData\\Local\\Programs\\Python\\Python314\\python.exe ~\\.vscode\\extensions\\ms-python.python-2026.4.0-win32-x64\\python_files\\normalizeSelection.py\n\n```\n\n\u003c/p>\n\u003c/details>\n\n\nExtension version: 2026.4.0\nVS Code version: Code 1.133.0 (a5b500951314efd502d07465bd138dfbd714a960, 2026-08-11T22:14:08Z)\nOS version: Windows_NT x64 10.0.26200\nModes:\n\n- Python version (& distribution if applicable, e.g. Anaconda): 3.14.1\n- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System\n- Value of the `python.languageServer` setting: Default\n\n\u003cdetails>\n\u003csummary>User Settings\u003c/summary>\n\u003cp>\n\n```\n\nlanguageServer: \"Pylance\"\n\n```\n\u003c/p>\n\u003c/details>\n\n\u003cdetails>\n\u003csummary>Installed Extensions\u003c/summary>\n\n|Extension Name|Extension Id|Version|\n|---|---|---|\n|copilot-chat|Git|0.61.0|\n|debugpy|ms-|2026.6.0|\n|js-debug|ms-|1.117.0|\n|js-debug-companion|ms-|1.1.3|\n|jsts-chat-features|Typ|0.0.4|\n|jupyter|ms-|2025.9.1|\n|jupyter-keymap|ms-|1.1.2|\n|jupyter-renderers|ms-|1.3.0|\n|python|ms-|2026.4.0|\n|vscode-js-profile-table|ms-|1.0.11|\n|vscode-jupyter-cell-tags|ms-|0.1.9|\n|vscode-jupyter-slideshow|ms-|0.1.6|\n|vscode-pylance|ms-|2026.3.1|\n|vscode-python-envs|ms-|1.36.0|\n\u003c/details>\n\u003cdetails>\n\u003csummary>System Info\u003c/summary>\n\n|Item|Value|\n|---|---|\n|CPUs|Intel(R) Core(TM) Ultra 9 275HX (24 x 3072)|\n|GPU Status|2d_canvas: enabled\u003cbr>GPU0: VENDOR= 0x10de, DEVICE=0x2d59 [NVIDIA GeForce RTX 5060 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1047 *ACTIVE*\u003cbr>GPU1: VENDOR= 0x8086, DEVICE=0x7d67 [Intel(R) Graphics], DRIVER_VERSION=32.0.101.8724\u003cbr>GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8875\u003cbr>Machine model name: \u003cbr>Machine model version: \u003cbr>direct_rendering_display_compositor: disabled_off_ok\u003cbr>gpu_compositing: enabled\u003cbr>multiple_raster_threads: enabled_on\u003cbr>opengl: enabled_on\u003cbr>rasterization: enabled\u003cbr>raw_draw: disabled_off_ok\u003cbr>skia_graphite: disabled_off\u003cbr>trees_in_viz: disabled_off\u003cbr>video_decode: enabled\u003cbr>video_encode: enabled\u003cbr>webgl: enabled\u003cbr>webgpu: enabled\u003cbr>webnn: disabled_off|\n|Load (avg)|undefined|\n|Memory (System)|31.46GB (11.06GB free)|\n|Process Argv|--crash-reporter-id c5f51013-4a2f-4960-8f4a-5f588a775082|\n|Screen Reader|no|\n|VM|0%|\n\u003c/details>\u003cdetails>\n\u003csummary>A/B Experiments\u003c/summary>\n\n```\nvsliv368cf:30146710\nvswsl492cf:30256860\nbinariesv615:30325510\nnativeloc1:31344060\ndwcopilot:31170013\ndwoutputs:31242946\ncopilot_t_ci:31333650\ne5gg6876:31282496\npythonrdcb7:31342333\n6518g693:31463988\naj953862:31281341\nenvsactivate1:31551504\n478i5457:31544283\ncloudbuttont:31379625\n3efgi100_wstrepl:31403338\n55ia6109:31457054\nec5jj548:31422691\ncp_cls_t_966_ss:31526232\n4je02754:31466945\nc3h7c220:31478652\ncp_cls_c_1081:31454833\nconptydll_true:31498968\ne9c30283:31461165\ntest_treatment2:31471001\nc9b86496:31447327\ncontrol_6dc23131:31555649\nei9d7968:31496641\nchat:31457767\n8hig5102:31480529\n89g7j272:31518289\ni2gc6536:31499202\n52612955:31516516\nghj88844:31499326\nddid_t:31478206\nhmra_i5g22:31518061\n7df3h592:31512476\ncp_cls_t_1082:31535311\nlogging_enabled_new:31498466\ndb5d2638:31499441\njb_cp_cls_t_632:31543129\n56dj4588:31512888\n32d76977:31512328\nha629193:31508444\ncdk-lw-on:31524445\njh5f2457_c:31540921\njbcp_cls_pctr_t:31531130\n61138546:31518536\ncp_intellij_t_nes:31548657\nd7b18187:31526828\nahp-both-windows:31556933\nsession_8:31532895\nhjji5903:31534458\nf412h606:31551416\n7g2b5551:31542111\nnes-ex-cf-euporie-03:31542868\nenable_editor_pane_layout:31567814\nallow-none:31555437\n6i51c363:31551401\nac562147:31564510\nc7c27ce7:31554789\n1h923230:31564177\n1532g621_copy:31554320\ntreatment-23-1:31555779\nunuse_dynamic_mcp:31555281\n0d8dfbc3:31566037\nmaidictation:31565333\n0c1h4866:31566224\nsession-archive:31558132\nbe7id924_c:31563078\n5b8j3302:31564601\n\n```\n\n\u003c/details>\n\n\u003c!-- generated by issue reporter -->","author":{"url":"https://github.com/BrazilForever11","@type":"Person","name":"BrazilForever11"},"datePublished":"2026-08-17T16:38:30Z","url":"https://github.com/microsoft/vscode-python/issues/26115"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:819cfaf1-72d5-040b-6bed-32b5961379a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C326:33D24F:A08479:CF75CE:6B00F543 |
| html-safe-nonce | 61db0d59e174516fd70435ed47b6d07819d824e6a1a0abc0da131cc96b6d5078 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzI2OjMzRDI0RjpBMDg0Nzk6Q0Y3NUNFOjZCMDBGNTQzIiwidmlzaXRvcl9pZCI6IjE4NDcxOTIyNjI0NDcwMDI5NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ade569189b3d409195d6d721cb166c1c5c5770d24d7134b723e7f2d4b343fcbd |
| hovercard-subject-tag | issue:5173463787 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-python/26115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30bbc535a5bb4c41ddee07f4c573d4fdb22dc161fce5fead5932de286504757b/microsoft/vscode-python/issues/26115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30bbc535a5bb4c41ddee07f4c573d4fdb22dc161fce5fead5932de286504757b/microsoft/vscode-python/issues/26115 |
| og:image:alt | Type: Bug Behaviour Right click selection -> Run Python -> run selection/line in the python terminal -> opens terminal, but does not execute code Steps to reproduce: Type: print("Hello, World!") Se... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BrazilForever11 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-python git https://github.com/microsoft/vscode-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 106462765 |
| octolytics-dimension-repository_nwo | microsoft/vscode-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 49946255 |
| octolytics-dimension-repository_parent_nwo | DonJayamanne/pythonVSCode |
| octolytics-dimension-repository_network_root_id | 49946255 |
| octolytics-dimension-repository_network_root_nwo | DonJayamanne/pythonVSCode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width