Repository navigation
Closed
Labels
bugIssue identified by VS Code Team member as probable bug
Description
Issue Type: Bug
Summary:
If I launch vscode from the terminal within a folder, I can run the project. But if I open folder from within vscode, it fails to run (It just seems to get stuck trying to run).
Steps to reproduce:
- open folder containing python project (any project, can be a single file containing print("hello world")
- Run. Doesn't work.
- close code and launch from terminal:
code . - Run. Works
Code:
test.py:
print("hello world")
.vscode/launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
Opening from terminal and running:

Opening folder and running (stuck like this):

Extension version: 2020.3.71659
VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:52:11.516Z)
OS version: Linux x64 5.3.0-45-generic snap
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 4000) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: disabled_software skia_renderer: disabled_off_ok video_decode: unavailable_off viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
| Load (avg) | 1, 1, 1 |
| Memory (System) | 15.54GB (0.33GB free) |
| Process Argv | . --no-sandbox |
| Screen Reader | no |
| VM | 0% |
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bug
Activity
int19h commentedon Apr 7, 2020
Can you clarify what command specifically you're using to run? Is it Run -> Start Debugging, Run -> Run Without Debugging, or are you using the "Run Python File in Terminal" toolbar button?
memoakten commentedon Apr 8, 2020
Hi, none of those methods work. I get the same results in each case.
In fact I realised my issue is that terminal doesn't open in code if I run it from gnome (see the lower picture in my orig post, no terminal). However if I run it from the terminal, it does work. I don't even need to open the folder from terminal with
'code .'. I can just launch from any folder with'code', and then open folder from within vscode, and it still works.I've tried /bin/bash and /bin/sh as my default shell, and neither of them work when launching vscode from gnome. (See settings below).
I had installed code via snap
sudo snap install code --classicand no updates are available.int19h commentedon Apr 16, 2020
To clarify, the terminal doesn't work at all? Not just specifically for debugging?
memoakten commentedon Apr 17, 2020
Yes, that was exactly the problem, the terminal wasn't launching at all (you can see no terminal in the image below). However, now the issue seems to be gone and terminal is working fine. At the time I posted the issue the latest vscode version was 1.43.2, now my vscode is 1.44.2. I'm not sure if it's related.
int19h commentedon Apr 27, 2020
I suspect that this has something to do with environment variables in a terminal session vs outside, perhaps affecting VSCode terminal functionality in general? Either way, glad to hear that it's fixed in a newer version!