microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.15k stars 28.83k forks source link

Source Control panel & gutters do not work when reopening in a dev container #166602

Closed DavidStanley94 closed 1 year ago

DavidStanley94 commented 1 year ago

Type: Bug

  1. Create an empty directory (e.g. open Command Prompt, call mkdir test_dir).
  2. Initialise git in the directory (e.g. cd test_dir, then git init).
  3. Open the created directory in VSCode (e.g. code .).
  4. Create a file with some content (e.g. a python file test.py containing print("Hello World!")).
  5. Observe that the VSCode Source Control panel is functioning (e.g. it displays the untracked file test.py).
  6. Reopen project in a default dev container (e.g. Dev Containers: Reopen in Container > (Add Dev Container Configuration Files) > Python 3 > 3.9 > none > OK).
  7. Observe that VSCode Source Control is not functioning. Its panel suggests that the folder currently open doesn't have a git repository. The Initialize Repository button does not appear to function.
  8. (Confirm that git is installed locally in the dev container by calling git --version in the bash terminal. Presently this returns git version 2.38.1.)

The actual result is that the Source Control panel and gutter markings do not function when a project is reopened in a dev container.

The expected result is that the Source Control panel and gutter markings function the same when the project is opened in a dev container as when the project is opened locally.

VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.77GB (16.02GB free)| |Process Argv|. --crash-reporter-id 03b2734b-de8a-4d8a-b2f7-0e6d468b4f63| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container: Python 3| |OS|Linux x64 5.10.16.3-microsoft-standard-WSL2| |CPUs|Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 x 2304)| |Memory (System)|15.52GB (14.17GB free)| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- vscode-drawio|hed|1.6.4 theme-by-language|jsa|1.2.1 theme-monokai-pro-vscode|mon|1.1.21 jupyter-keymap|ms-|1.0.0 remote-containers|ms-|0.262.3 remote-ssh|ms-|0.92.0 remote-wsl|ms-|0.72.0 vscode-remote-extensionpack|ms-|0.23.0 remote-explorer|ms-|0.0.2 autocomplate-shell|tru|0.1.1 vscode-eslint|dba|2.2.6 isort|ms-|2022.8.0 python|ms-|2022.18.2 vscode-pylance|ms-|2022.11.30 jupyter|ms-|2022.9.1303220346 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.12 vscode-jupyter-cell-tags|ms-|0.1.6 vscode-jupyter-slideshow|ms-|0.1.5 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyonecf:30548226 vsccc:30610678 pyindex848:30577860 nodejswelcome1:30587005 fc301958:30595537 282f8724:30602487 gswce1:30612156 3d0df643:30613357 dbltrim-noruby:30604474 89544117:30613380 ```
DavidStanley94 commented 1 year ago

Possible related issue: https://github.com/microsoft/vscode/issues/68038

lszomoru commented 1 year ago

@DavidStanley94, I notice that you are running VS Code on Windows, and you have WSL. Couple of questions:

  1. Do you run docker in WSL or in Windows when you are reopening the folder in a container?
  2. Is the test_dir folder created on the WSL file system or the Windows file system?
DavidStanley94 commented 1 year ago

@DavidStanley94, I notice that you are running VS Code on Windows, and you have WSL. Couple of questions:

  1. Do you run docker in WSL or in Windows when you are reopening the folder in a container?
  2. Is the test_dir folder created on the WSL file system or the Windows file system?

@lszomoru

  1. I have Docker Desktop installed on Windows and have it running. Then I use VSCode on Windows. Then I use the reopen in a container command within VSCode. (If I quit / stop running Docker Desktop, the attempt to reopen in a container fails, with it saying the Docker daemon is not running.)
  2. It is created in the Windows file system. (The overarching usage is that I am developing on Windows using GitHub Desktop, Docker Desktop, VSCode installed on Windows.)
lszomoru commented 1 year ago

Closing this as duplicate of https://github.com/microsoft/vscode-remote-release/issues/7628.