2

Created docker image to encapsulate vscode editor and its settings to provide consistent development experience. Each time image is executed to create container and start editor (for the first time), this notification appears in lower right hand corner of screen: "Help improve VS Code by allowing Microsoft to collect usage data. Read our privacy statement and learn how to opt in." I want to disable the generation of this notification.

So far the following key value pairs included in settings.json have been tried to silence the notification but it continues to appear:

"telemetry.enableTelemetry": false,
"editor.parameterHints": false,

In scanning the vscode github source, this module controls the notification's appearance via a key: "workbench.telemetryOptOutShown" whose type is a boolean. This key value pair is stored in a file named: "file__0.localstorage" located in the directory "~/.config/Code/Local Storage" created when first running vscode. Further code inspection revealed key being searched in only "StorageScope.GLOBAL". Thought that perhaps updating settings.json file, since these settings are global to the user, might allow control of "workbench.telemetryOptOutShown". This key with a value of true was added to the "User Settings" via vscode. Although vscode generated an error indicating that this key was an invalid configuration setting, I tried anyway. As expected by the error message, adding this key value pair didn't silence the notification.

Although this issue can be resolved by using a copy of "file__0.localstorage" when generating the Docker image, I'd rather avoid this technique for several reasons.

1
  • Would you mind sharing your Dockerfile / commands? I suspect running vscode via Docker may not be that straight-forward.
    – V-R
    Commented Sep 29, 2019 at 14:49

1 Answer 1

1

Here is how it is done in vscodium/undo_telemetry.sh

# dc.services.visualstudio.com
# vortex.data.microsoft.com
TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
REPLACEMENT="s/$TELEMETRY_URLS/0\.0\.0\.0/g"

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i '' -E $REPLACEMENT
else
  grep -rl --exclude-dir=.git -E $TELEMETRY_URLS . | xargs sed -i -E $REPLACEMENT
fi

To provide a consistent VSCode-like development experience without telemetry, I would try switching to VSCodium whose raison d'être includes disabling it.

Quoting their README.md:

VSCodium

Free/Libre Open Source Software Binaries of VSCode

This is not a fork. This is a repository of scripts to automatically build Microsoft's vscode repository into freely-licensed binaries with a community-driven default configuration.

As of September 2019, it may have some issues with automatic updates but for consistency I feel these should be disabled to begin with.

Since April VSCodium is also available in the portable, cross-platform AppImage format, so it should be easy to go back and forth between versions and give new ones a thorough test before updating the standard environment shared by a group of developers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .