4

run the command as below:

sudo snap install --classic vscode

I install the vscode successfully. But I can not launch the vscode.

wlos
  • 41

3 Answers3

6

If

code

doesn't work try

snap run code
empty
  • 371
2

I installed vscode with the same command, and it launched when I clicked on the Visual Studio Code icon in the Dash.

There are now two Visual Studio Code snap packages in Ubuntu: code and code-insiders. code-insiders is the newer snap package that was packaged by Microsoft. To start these packages from the terminal type:

snap run code-insiders

or

snap run code  

For more information read my other answer about installing Visual Studio Code.

karel
  • 114,770
  • I have found the vscode in Dash. – wlos May 31 '17 at 01:59
  • What happens when you try to launch it from the terminal with the command vscode ? – karel May 31 '17 at 02:13
  • It shows "command not found". But now I can launch the vscode through Dash or terminal after restarting my computer. – wlos May 31 '17 at 12:45
  • When I installed vscode on my computer it launched immediately by clicking on the icon, but I guess it's alright now. Watch out when installing debugging extensions. They try to turn your Ubuntu into Windows and then they don't work anyway. – karel May 31 '17 at 12:53
  • I am in the VScode terminal and want to open a file from there, like "code file1". "Code" is not recognized, this is a path issue to solve. "snap run code" opens a new VSCode instance which I do not want. Similar action would be "ctrl+1"/go to editor and "ctrl+o", which is my current procedure. . In windows "code" from the terminal works, but not in Ubuntu. – Timo Nov 01 '20 at 06:32
  • I got the solution to my observation from some minutes before, in preferences: "window.openFilesInNewWindow": "off" – Timo Nov 01 '20 at 06:55
0

It turns out the executable name is "code". So, all you need to do is enter:

   code

If you navigate to a project folder and do:

   code .

Then, it will open that folder as a "project".