Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Overview

Microsoft Visual Studio Code is software Microsoft makes available for free at https://code.visualstudio.com/Download.  While Microsoft generally fixes issues the crop up on Windows operating systems, they have very little incentive to patch issues the crop up on their competitors operating systems, this results in a variety of issues that are known, have workarounds posted, but have not had their underlying issues solved. 

Problem 1

When accessing the software remotely from a Mac computer, certain keys do not work as intended. symptoms include pressing AltGr acts as Backspace, pressing C acts as ArrowLeft, or pressing e acts a delete, etc.

Solution 1

VS Code on Linux dispatches keybindings using scan codes to accommodate various keyboard layouts. This works well when sitting physically at the machine and the OS is the one creating keyboard events, but some virtualization / remote desktop software creates keyboard events with incorrect scan codes.

  1. go to file >> preferences>>settings

  2. search for "keyboard"

  3. click on "keyboard" (bottom one)

  4. use "keyboard.dispatch": "keyCode" in your settings instead of "Code"

  5. restart VS Code.

Problem 2

On a Mac or Linux computer, pressing key combinations results in no action. If solution 1 does not work, this might help

Solution 2

  1. go to file >> preferences>>keyboard shortcuts

  2. search for the action you want to the combination to call

  3. Right click on the listed combination and then click "remap"
  4. type the combination you want to use and then click enter

Problem 3

Microsoft Visual Studio Code is consuming a lot of CPU

Solution 3

High CPU consumption is often caused by an issue in an extension, especially if running remotely or from a non-windows environment. VS Code running multiple processes and extensions are executed by the Extension Host process.

Find out whether an extension is causing the high CPU load. You can open the Process Explorer using Help>Open Process Explorer to open a new window with a continuously updating list of VS Code processes.

Disable extensions one at a time to see if that extension is the one causing an issue

Problem 4

Microsoft Visual Studio Code is giving useless error messages

Solution 4

  • You can use a keyboard shortcut, Control+Shift+P on Windows or Command+Shift+P on MacOS to open the command palette.
  • type "show log"
  • you will see "Remote-SSH: Show Log" as an option. it opens the bottom pane to show the log while it's connecting. It is similar to running ssh with the -v option (verbose)
  • (Optional) In a normal terminal window type "quota your_username" where your_username is your CoE username. If you are over the space or file quota indicated by an * next to a number, VS will act weird.

Problem 5

Microsoft Visual Studio Code is not allowing a person to login to a remote computer, also known as a remote target after said remote computer has not been used for some time.

or

Microsoft Visual Studio Code is not allowing a person to login to a remote computer such a CSIL, but you are still able to login via ssh and terminal

Solution 5

This is actually multiple possible problems 1) saved credentials do not match current credentials or 2) saved computer does not match current computer or 3) unspecified other permissions issue, but since the VS error message can be the same as well as the solution, we are lumping them together. If its a type 3) situation, please see Solution 4 above.

"Host key verification failed" means that the host key of the remote host was changed. This happens after major changes such as when we reimage our computers every quarter.

VS code will stop you from connecting because it can also be a sign of spoofing, that the remote computer is not the one you think it is. So good security if you assume your remote computer never changes, which is a bad assumption in our case.

"invalid credentials" means that you changed your password and your current credentials do not match your saved credentials.

Once you clear credentials from the current instance, some extensions may prompt for authentication the next time you open VS Code. You can continue working in the current session.

"permission denied" can be either of the above as well as several other errors. e.g. your are using your ECE or UCSBnetID credentials on a CoE computer or vice versa. See Solution 4 above.

  • to clear ssh keys, also known as ssh targets, you can remove it on the SSH config file ~/.ssh/config where ~ is your home directory and exact path will vary person to person.
  • It is also a good idea to clear the ssh host key/target off ~/.ssh/known_hosts which is the file used by almost every other ssh program.
  • (Optional) Some extensions save credentials and need to be cleared as well.
    • On Windows: you can press windows key + r then type %USERPROFILE%\.%EXTENSION_NAME_HERE% where % indicates a variable and EXTENSION_NAME_HERE is your extension

    • On Linux and Mac OS: ~/.EXTENSION_NAME_HERE

    • For Ubuntu/GNOME Visual Studio Code users, the Credential Manager can be accessed by launching the "Passport and Keys" application. You can delete the Visual Studio Code/GitHub entry by clicking "Password", looking for the entry and delete

    • some extensions (no where near a complete list) are ~/.vscode-server for the default server, .sfdx for salesforce, .git or .github or .git-credentials for git/gitlab/github and assorted other repositories
    • In that directory you'll find a json file for each login saved, each one named after your username in that org. That json holds the following properties:

      • username
      • orgId
      • accessToken
      • refreshToken
      • instanceUrl
      • loginUrl
      • clientId

      You can delete the ones you don't need.

  • (Optional) Navigate to Code > Preferences > Settings > Workspace > Extensions > your_extension_name_here  to check whether the credentials and the instance URL have been deleted for all extensions

"over quota" means you have used up your quota, you allocation of space and files, and cannot write the files that VS code needs to write to in order to login. Solution is the same as Solution 4 above.

#to see your current quota: 
quota -s USERNAME

#to see your 10 biggest files:
top10

#to see the size of a specific directory such as .cache
du -sh example_directory
du -sh .cache

#to clear your cache, for example if you have misconfigured your VS code logs
clearcache

External Sources of information

https://github.com/microsoft/vscode/wiki



  • No labels