Vscode-remote-release: Changed `tasks.json` not applied until window reloaded

Created on 11 Aug 2020  路  7Comments  路  Source: microsoft/vscode-remote-release


Symptom

When project opened in remote, all changes applying to tasks.json require a window reload to take effect.

Environments

  • VSCode Version: 1.47.3 (user setup)
  • Local OS Version: Windows_NT x64 10.0.19041
  • WSL Version: WSL2
  • Docker Version: Docker Desktop (2.3.0.4) / Docker Engine (19.03.12) / WSL2 enabled
  • Remote OS Version: see below
  • Remote Extension/Connection Type: Confirmed on WSL and Container, SSH not tested.

    • Remote-Container (v0.128.0) + Alpine (mcr.microsoft.com/vscode/devcontainers/base:0-alpine-3.12)

    • Remote-Container (v0.128.0) + Node (mcr.microsoft.com/vscode/devcontainers/javascript-node:0-10)

    • Remote-WSL (v0.44.4) + Ubuntu 20.04

Steps to Reproduce:

  1. Create tasks.json with some tasks defined..
  2. Reopen folder in remote, or reload window if already opened in remote.
  3. Update tasks.json and save.
  4. Execute task that just changed.

Expected result:

Updated task should be executed.

Actually result:

Updated task not taken effect and Old task was executed.

Additional information:


Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

bug containers upstream

All 7 comments

Could you post the before and after JSON of the task? (Tried to reproduce with a simple echo.)

Could you post the before and after JSON of the task? (Tried to reproduce with a simple echo.)

You can check this repository: https://github.com/pingu8007/vscode-remote-3497

To reproduce, open this directory within Container or WSL, make some changes on tasks.json such as:

diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index a4ea5f4..649a750 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -14,7 +14,7 @@
     {
       "label": "printenv",
       "type": "shell",
-      "command": "printenv | grep MY_VARIABLE"
+      "command": "printenv #| grep MY_VARIABLE"
     }
   ]
 }
\ No newline at end of file

Then save and execute task without window reload.

Changes will be applied without issue when opened locally. Otherwise, both Container and WSL require a window reload to take effect.

@pingu8007 where is your task file? This sounds similar to this issue, where the location of the file seems to make a difference: https://github.com/microsoft/vscode/issues/96537#issuecomment-635714095

@pingu8007 where is your task file? This sounds similar to this issue, where the location of the file seems to make a difference: microsoft/vscode#96537 (comment)

@alexr00 I initiated the repository under Windows and all those files were located in C: (/mnt/c under WSL)

I tried cloning repository under WSL and poking around, and just as the issue said, all symptoms only happened when folder located inside /mnt/c. Either clone into /mnt/c directly or clone to somewhere then move into will produce this symptom.

@pingu8007 thanks for the extra investigation!

@chrmarti I don't think this problem is specific to tasks. Since its the same as https://github.com/microsoft/vscode/issues/96537#issuecomment-635714095, it also occurs with snippets and launch. I suspect a file watching issue.

In addition to above, I have checked the trace log and there were no further message after file watching started:

[2020-08-17 17:25:23.822] [remoteagent] [trace] [File Watcher (chokidar)] Start watching with chockidar: /mnt/c/Users/pingu/repositorys/container-test, excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/.hg/store/**,**/node_modules/*/**,/home/pingu/.vscode-server/extensions/**,**/*.asar, usePolling: false

The refresh of VCS panel also fallback to regular polling every few seconds.

(btw, there is a typo in the log chockidar)

Was this page helpful?
0 / 5 - 0 ratings