How to disconnect VSCode completely from accessing the internet? - visual-studio-code

I've disabled Telemtry and Crash updater from my VSCode settings. Still VSCode makes requests to the internet. I think It does that to query extension results and downloading, update the VSCode software, fetch the internet images in my markdown etc.
Consider I just installed VSCode, setup extensions which I want and then I'll choose to manually update VSCode from now on.
In windows defender "Allow an app through Firewall", I don't see VSCode there so that I can disable internet to VSCode.
I don't want any new extensions or updates, no fetching images from internet etc. Is there a way I can disconnect VSCode completely from accessing the internet?

Go To File --> Preferences --> Settings.
Type in the search bar "Update".
And disable what you need.They have a setting for everything. For example:
Extensions: Auto Check Updates --> Uncheck
Update: Enable Windows Background Update --> Uncheck.
Please See Attached Photo.

Related

How to add "onView" "Settings" Page as ActivationEvent for vscode Extension?

The title is the TL;DR, but I'll start off with intent, I'm working on a vscode extension that have configuration/settings that will have an initial auto-detection (on activation) and populated during runtime, eg. selectable version of application installed on the computer (such as LLVM that could have 13 and/or 14). The closest is something like the built-in git extension's executable path detection.
So basically this runtime detection means I cannot use the configuration contribution points as everything in package.json is hardcoded...
Back to activation, the extension can be activated on any few commands indicated in the activationEvents, but the main thing is the detection must be done prior to users opening the Preferences: Open Settings (UI), I've looked through the vscode repo and found onCommand:workbench.action.openSettings2 to be closest to what I need, however I found a niche scenario where if the user have "Settings" page opened prior to installing the extension and relaunching vscode will jump straight to the Settings page, this will not activate the extension.
I checked the built-in git extension and found that they have been using "*" which is not recommended, so I'm using onStartupFinished as a workaround for now.
I found onView may be what I am looking for, but how do I know what is the editor/webview name for "Settings" page - onView:xxx.openSettings?

github login and sync failure in updated vscode linux version

recently I installed a fresh version of the KDE neon user edition and I updated it and works fine.
I also installed the vscode Debian version and nothing is wrong.
but when I want to login with my GitHub account in vscode for configs sync it opens a firefox tab that I log in to my GitHub and authorizes the vscode and it succeeds and gets back to vscode and instead of signing in and syncing the configs it opens an empty unsaved file named something like this:
did-authenticate\?windowid\=1\&code\=6beea2fcb8a47e0ea49e\&state\=2efc5efd-9c68-4735-a4a0-fd690dd7aec0
in this path : "~/vscode:/vscode.GitHub-authentication"
and after a few seconds canceled notification appears.
I've installed vscode for Debian version 1.63.2 which people in this Github issue had the same problem in version 1.62.2 and they are saying that this problem is fixed for them in version 1.62.3.
I don't have this problem with the Microsoft account sign-in.
what am I missing?
Update:
for testing, I tried to install an extension for vscode and I pasted the URL with vscode protocol in a web browser like this (vscode:extension/GitHub.vscode-pull-request-github), and instead of opening the vscode extensions tab, it goes back to vscode and opens an empty file in the same directory ("~/vscode:/vscode.GitHub-authentication").
so this is vscodes fault that cant handle the vscode: URLs.
I found out what the problem is but I don't know how to fix it
for the record I've updated the vscode today to the 1.64.1 version and still have the problem.
enter image description here
First, you need to get the GitHub Pull Requests and Issues and GitHub extensions together. Then go to the section specified in the photo and give the details of the account and repository you are using. And then it will be fixed.
I ran into this issue myself and discovered that it's because the VS Code command-line application isn't designed to handle URLs, but local file paths. VS Code registers the vscode:// URL scheme with XDG using an appropriate *.desktop file and these URLs should be opened using the command-line program xdg-open. In Firefox, if you have not yet set a default application for vscode:// URLs, then it will ask you for a program to open it with, select /usr/bin/xdg-open. If you have already set it to a different default, you can change it as follows: go to the Menu -> Settings -> General -> Applications -> vscode -> Use other... -> Select /usr/bin/xdg-open as the program for vscode.
With the default for vscode:// URLs set to use xdg-open, then any future integration with VS Code should work naturally to open it as expected.

Is there a way to sync the settings between local and remote for vscode?

So the latest version of vscode (1.46) provides preference sync, but I found I cannot enable this feature for remote vscode. Whenever I open remote folder, (e.g., in wsl), the option to sign in MS account and turn on preference sync is missing. Did I miss anything here or it is not supported?
figure below shows my local vscode instance with the preference sync:
figure below shows my vscode instance for remote (wsl) without the preference sync option:
https://code.visualstudio.com/docs/editor/settings-sync
I was looking to enable this too, the first line is the answer I think. Only available for vscode insiders at the moment, maybe wait 'til next month

Open Link in VSCode Will Create a New Web Browser Under Same Icon as VSCode

I am using VScode version 1.45 with Firefox version 76.0.1 as a default browser (with Ubuntu 18.04.4 LTS). Whenever I tried to open a link in the VSCode, it will open the Firefox browser under same icon as VSCode, and I cannot merge these tabs into existing Firefox web browser.
Same thing also happens when I try to run a program using live server extension. But when I use npm to start the development server, it will create a new window or tab under the Firefox icon.
How could I fix this so whenever I open a browser from VSCode, it will create a new browser or tab under the appropriate (Firefox) icon? Thank you.
There is already an issue on VSCode's GitHub repository and as it is mentioned in the issue, origin of the issue is in snapd.
To fix the issue, as mentioned on aforementioned github issue:
Open some URL from the VSCode snap.
In the new window, navigate to about:profiles.
Ensure that the profile marked as "Default Profile" matches Firefox when opened normally. If not, use the "Set as default profile" button under the correct profile to change the default.
Try making firefox your default browser thorugh firefox and also do check that firefox is your default browser from vscode
I found this solution the best solution
You might have installed VSCode as a snap package, which causes
$XDG_CACHE_HOME to be set to ~/snap/code/common/.cache, which could
cause some cli tools to mistake that for your cache directory, and
install/launch binaries from there.
If you install VSCode from the .deb download, it should fix your issue
I removed vscode from Ubuntu software and download the .deb file from vscode site and install it ... problem solved

Allow guests to a VS Code Live Share session to run Python extension 'cells'

When guests in a VS Code Live Share session try to run VS Code Python extension 'cells', they will get the following message in an error pop-up dialog in the lower right:
The host doesn’t allow running this command.
If needed, ask them to enable it.
Clicking on the "More info" button of the pop-up dialog, directs the guest to https://learn.microsoft.com/en-us/visualstudio/liveshare/reference/security. I cannot find on this page where it describes how to allow guests to use certain features of particular VS Code extensions.
As a host, how do I allow guests to my VS Code Live Share session to run VS Code Python extension 'cells'?
Analogous to Guest Debugging (https://github.com/MicrosoftDocs/live-share/issues/2154), there is an option to "Allow Guest Command Control" in the VSCode Live Share extension settings (in VSCode, open the extensions sidebar - under "Installed", click on the settings wheel next to "Live Share" - Extension Settings). Enabling this should do the trick (could not test this, yet).
There may be some additional issues depending on version: https://github.com/MicrosoftDocs/live-share/issues/3121