Visual studio code linux

Visual studio code linux

начало работы использование Visual Studio Code с подсистема Windows для Linux

Visual Studio Code, вместе с расширением Remote-WSL, позволяет использовать WSL в качестве среды разработки для полной времени непосредственно из VS Code. Все они перечислены ниже.

установка VS Code и расширения Remote WSL

перейдите на страницу установки VS Code и выберите двоичный установщик 32 или 64. установите Visual Studio Code на Windows (а не в файловую систему WSL).

Установите Пакет расширений для удаленной разработки. Этот пакет расширений включает расширение Remote-WSL в дополнение к расширениям Remote-SSH и Remote-Container, что позволяет открывать любую папку в контейнере, на удаленном компьютере или в WSL.

Обновление дистрибутива Linux

в некоторых дистрибутивах WSL Linux отсутствуют библиотеки, необходимые для запуска сервера VS Code. Вы можете добавить дополнительные библиотеки в дистрибутив Linux с помощью диспетчера пакетов.

Например, чтобы обновить Debian или Ubuntu, используйте:

Чтобы добавить wget (для получения содержимого с веб-серверов) и CA-Certificates (чтобы разрешить приложениям на основе SSL проверять подлинность SSL-соединений), введите:

Откройте проект WSL в Visual Studio Code

Из командной строки

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Из VS Code

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

расширения в VS Code Remote

расширение Remote-WSL разделяет VS Code в архитектуру «клиент-сервер» с помощью клиента (пользовательского интерфейса), работающего на компьютере Windows, и сервера (код, Git, подключаемые модули и т. д.), запускаемые удаленно.

при запуске VS Code удаленно на вкладке «расширения» отобразится список расширений, разделенных между локальным компьютером и дистрибутивом WSL.

Установка локального расширения, например темы, должна быть установлена только один раз.

Некоторые расширения, такие как расширение Python или все, что обрабатывает такие действия, как linting или Отладка, должны устанавливаться отдельно на каждом удаленном распределении WSL. VS Code отобразит значок ⚠ предупреждения, а также зеленую кнопку «установить в WSL», если установлено локальное расширение, которое не установлено на удаленном компьютере WSL.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

дополнительные сведения см. в VS Code документах:

возникли проблемы при запуске VS Code из командной строки WSL? В этом руководство по устранению неполадок содержатся советы по изменению переменных пути, устранению ошибок расширения, связанных с отсутствием зависимостей, устранению проблем с завершением строк Git, установке локального VSIX на удаленном компьютере, запуску окна браузера, порту localhost для блокировки, веб-сокеты не работают, ошибки при хранении данных расширения и многое другое.

Установка Git (необязательно)

Если вы планируете работать совместно с другими пользователями или размещать проект на сайте с открытым исходным кодом (например, GitHub), примите во внимание, что VS Code поддерживает управление версиями с помощью Git. Вкладка системы управления версиями в VS Code отслеживает все изменения и содержит общие команды Git (добавление, фиксация, принудительная отправка, извлечение) прямо в пользовательском интерфейсе.

Установка Терминала Windows (необязательно)

новая Терминал Windows включает несколько вкладок (быстро переключаться между дистрибутивами командной строки, PowerShell или несколькими установочными областями Linux), пользовательскими привязками клавиш (создайте собственные сочетания клавиш для открытия и закрытия вкладок, копирования и вставки и т. д.), эмодзи ☺ и пользовательских тем (цветовые схемы, стили и размеры шрифтов, фоновое изображение, размытие и прозрачность). Дополнительные сведения см. в документации по Терминалу Windows.

Скачайте Терминал Windows из Microsoft Store: При установке через магазин обновления выполняются автоматически.

Дополнительные ресурсы

К дополнительным рекомендуемым расширениям относятся следующие:

Remote Development with Linux

Linux is a highly variable environment and the large number of server, container, and desktop distributions can make it difficult to know what is supported. Visual Studio Code Remote Development has prerequisites for the specific host / container / WSL distribution you will be connecting to.

The extensions are known to work when connecting to recent stable/LTS version of:

The following non-Linux SSH hosts are also supported:

However, if you are using a non-standard configuration or downstream distribution of Linux, you may run into issues. This document provides information on requirements as well as tips to help you get up and running even if your configuration is only community-supported.

Note that other extensions may have dependencies beyond those listed here. Some extensions also contain compiled native code that may not work on Alpine Linux, or ARMv7 (AArch32), or ARMv8 (AArch64). These platforms are considered in «preview» for this reason. If you encounter an issue that only occurs with a particular extension, contact the extension authors for information on their native dependencies.

Local Linux prerequisites

If you are running Linux locally, the VS Code prerequisites drive most of the requirements.

In addition, specific Remote Development extensions have further requirements:

Remote host / container / WSL Linux prerequisites

Platform prerequisites are primarily driven by the version of the Node.js runtime (and by extension the V8 JavaScript engine) shipped in the server component automatically installed on each remote endpoint. This server also has a set of related native node modules that need to be compiled and tested for each target. 64-bit x86 glibc-based Linux distributions currently provide the best support given these requirements.

You may encounter issues with certain extensions with native dependencies with ARMv7l (AArch32) / ARMv8l (AArch64) glibc-based hosts, containers, or WSL and 64-bit x86 musl-based Alpine Linux. For ARMv7l/ARMv8l, extensions may only include x86_64 versions of native modules or runtimes in the extension. For Alpine Linux, included native code or runtimes may not work due to fundamental differences between how libc is implemented in Alpine Linux ( musl ) and other distributions ( glibc ). In both these cases, extensions will need to opt-in to supporting these platforms by compiling / including binaries for these additional targets. Please raise an issue with the appropriate extension author requesting support if you encounter an extension that does not work as expected.

Tips by Linux distribution

The following is a list of distributions and any base requirements that may be missing. End-of-life versions of distributions are not included.

Updating glibc and libstdc++ on RHEL / CentOS 6

RHEL / CentOS 6 ships with glibc 2.12 and libstdc++ 3.4.13. Unfortunately, this does not meet the requirements for Remote Development. RHEL / CentOS 6 goes out of support in 2020, so we recommend upgrading to RHEL / CentOS 7 or higher.

However, as a workaround, you can either build glibc manually or use the following script to install updated binaries. The bash script below will upgrade these libraries without having to build them. It is adapted from information in this article, this gist, and this Fedora copr project. The article also includes instructions for manually building glibc if you would prefer not to use the binaries from the article.

Do not run this script on anything mission critical without a rollback strategy since it does update libraries that other applications depend on.

For servers, run the following script and restart the server so the updates take effect.

In a container environment, you can add similar contents to a Dockerfile:

Visual Studio Code on Linux

Installation

See the Download Visual Studio Code page for a complete list of available installation options.

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement.

Debian and Ubuntu based distributions

Note that other binaries are also available on the VS Code download page.

Then update the package cache and install the package using:

RHEL, Fedora, and CentOS based distributions

We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:

Then update the package cache and install the package using dnf (Fedora 22 and above):

Or on older versions using yum :

Due to the manual signing process and the system we use to publish, the yum repo may lag behind and not get the latest version of VS Code immediately.

Visual Studio Code is officially distributed as a Snap package in the Snap Store:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can install it by running:

Once installed, the Snap daemon will take care of automatically updating VS Code in the background. You will get an in-product update notification whenever a new update is available.

Note: If snap isn’t available in your Linux distribution, please check the following Installing snapd guide, which can help you get that set up.

Learn more about snaps from the official Snap Documentation.

openSUSE and SLE-based distributions

The yum repository above also works for openSUSE and SLE-based systems, the following script will install the key and repository:

Then update the package cache and install the package using:

AUR package for Arch Linux

To get more information about the installation from the AUR, please consult the following wiki entry: Install AUR Packages.

Nix package for NixOS (or any Linux distribution using Nix package manager)

There is a community maintained VS Code Nix package in the nixpkgs repository. In order to install it using Nix, set allowUnfree option to true in your config.nix and execute:

Note that other binaries are also available on the VS Code download page.

Updates

VS Code ships monthly and you can see when a new release is available by checking the release notes. If the VS Code repository was installed correctly, then your system package manager should handle auto-updating in the same way as other packages on the system.

Note: Updates are automatic and run in the background for the Snap package.

Node.js

Node.js is a popular platform and runtime for easily building and running JavaScript applications. It also includes npm, a Package Manager for Node.js modules. You’ll see Node.js and npm mentioned frequently in our documentation and some optional VS Code tooling requires Node.js (for example, the VS Code extension generator).

If you’d like to install Node.js on Linux, see Installing Node.js via package manager to find the Node.js package and installation instructions tailored to your Linux distribution. You can also install and support multiple versions of Node.js by using the Node Version Manager.

To learn more about JavaScript and Node.js, see our Node.js tutorial, where you’ll learn about running and debugging Node.js applications with VS Code.

Setting VS Code as the default text editor

xdg-open

You can set the default text editor for text files ( text/plain ) that is used by xdg-open with the following command:

Debian alternatives system

Debian-based distributions allow setting a default editor using the Debian alternatives system, without concern for the MIME type. You can set this by running the following and selecting code:

Windows as a Linux developer machine

Another option for Linux development with VS Code is to use a Windows machine with the Windows Subsystem for Linux (WSL).

Windows Subsystem for Linux

With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on a Windows machine. WSL supports Linux distributions such as Ubuntu, Debian, SUSE, and Alpine available from the Microsoft Store.

See the Developing in WSL documentation to learn more or try the Working in WSL introductory tutorial.

Next steps

Once you have installed VS Code, these topics will help you learn more about it:

Common questions

Azure VM Issues

I’m getting a «Running without the SUID sandbox» error?

You can safely ignore this error.

Debian and moving files to trash

If you see an error when deleting files from the VS Code Explorer on the Debian operating system, it might be because the trash implementation that VS Code is using is not there.

Run these commands to solve this issue:

Conflicts with VS Code packages from other repositories

Some distributions, for example Pop!_OS provide their own code package. To ensure the official VS Code repository is used, create a file named /etc/apt/preferences.d/code with the following content:

«Visual Studio Code is unable to watch for file changes in this large workspace» (error ENOSPC)

The limit can be increased to its maximum by editing /etc/sysctl.conf (except on Arch Linux, read below) and adding this line to the end of the file:

While 524,288 is the maximum number of files that can be watched, if you’re in an environment that is particularly memory constrained, you may want to lower the number. Each file watch takes up 1080 bytes, so assuming that all 524,288 watches are consumed, that results in an upper bound of around 540 MiB.

Arch-based distros (including Manjaro) require you to change a different file; follow these steps instead.

I can’t see Chinese characters in Ubuntu

Package git is not installed

This error can appear during installation and is typically caused by the package manager’s lists being out of date. Try updating them and installing again:

The code bin command does not bring the window to the foreground on Ubuntu

Under General > General Options > Focus & Raise Behaviour, set «Focus Prevention Level» to «Off». Remember this is an OS-level setting that will apply to all applications, not just VS Code.

This can happen when sources.list.d doesn’t exist or you don’t have access to create the file. To fix this, try manually creating the folder and an empty vscode.list file:

Cannot move or resize the window while X forwarding a remote window

Using the custom title bar

The custom title bar and menus were enabled by default on Linux for several months. The custom title bar has been a success on Windows, but the customer response on Linux suggests otherwise. Based on feedback, we have decided to make this setting opt-in on Linux and leave the native title bar as the default.

The custom title bar provides many benefits including great theming support and better accessibility through keyboard navigation and screen readers. Unfortunately, these benefits do not translate as well to the Linux platform. Linux has a variety of desktop environments and window managers that can make the VS Code theming look foreign to users. For users needing the accessibility improvements, we recommend enabling the custom title bar when running in accessibility mode using a screen reader. You can still manually set the title bar with the Window: Title Bar Style ( window.titleBarStyle ) setting.

Broken cursor in editor with display scaling enabled

Repository changed its origin value

If you receive an error similar to the following:

Use apt instead of apt-get and you will be prompted to accept the origin change:

Visual studio code linux

Visual Studio Code on Linux

See the Download Visual Studio Code page for a complete list of available installation options.

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement.

Debian and Ubuntu based distributions

Note that other binaries are also available on the VS Code download page.

Then update the package cache and install the package using:

RHEL, Fedora, and CentOS based distributions

We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:

Then update the package cache and install the package using dnf (Fedora 22 and above):

Or on older versions using yum :

Due to the manual signing process and the system we use to publish, the yum repo may lag behind and not get the latest version of VS Code immediately.

Visual Studio Code is officially distributed as a Snap package in the Snap Store:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can install it by running:

Once installed, the Snap daemon will take care of automatically updating VS Code in the background. You will get an in-product update notification whenever a new update is available.

Note: If snap isn’t available in your Linux distribution, please check the following Installing snapd guide, which can help you get that set up.

Learn more about snaps from the official Snap Documentation.

openSUSE and SLE-based distributions

The yum repository above also works for openSUSE and SLE-based systems, the following script will install the key and repository:

Then update the package cache and install the package using:

AUR package for Arch Linux

To get more information about the installation from the AUR, please consult the following wiki entry: Install AUR Packages.

Nix package for NixOS (or any Linux distribution using Nix package manager)

There is a community maintained VS Code Nix package in the nixpkgs repository. In order to install it using Nix, set allowUnfree option to true in your config.nix and execute:

Note that other binaries are also available on the VS Code download page.

VS Code ships monthly and you can see when a new release is available by checking the release notes. If the VS Code repository was installed correctly, then your system package manager should handle auto-updating in the same way as other packages on the system.

Note: Updates are automatic and run in the background for the Snap package.

Node.js is a popular platform and runtime for easily building and running JavaScript applications. It also includes npm, a Package Manager for Node.js modules. You’ll see Node.js and npm mentioned frequently in our documentation and some optional VS Code tooling requires Node.js (for example, the VS Code extension generator).

If you’d like to install Node.js on Linux, see Installing Node.js via package manager to find the Node.js package and installation instructions tailored to your Linux distribution. You can also install and support multiple versions of Node.js by using the Node Version Manager.

To learn more about JavaScript and Node.js, see our Node.js tutorial, where you’ll learn about running and debugging Node.js applications with VS Code.

Setting VS Code as the default text editor

You can set the default text editor for text files ( text/plain ) that is used by xdg-open with the following command:

Debian alternatives system

Debian-based distributions allow setting a default editor using the Debian alternatives system, without concern for the MIME type. You can set this by running the following and selecting code:

Windows as a Linux developer machine

Another option for Linux development with VS Code is to use a Windows machine with the Windows Subsystem for Linux (WSL).

Windows Subsystem for Linux

With WSL, you can install and run Linux distributions on Windows. This enables you to develop and test your source code on Linux while still working locally on a Windows machine. WSL supports Linux distributions such as Ubuntu, Debian, SUSE, and Alpine available from the Microsoft Store.

See the Developing in WSL documentation to learn more or try the Working in WSL introductory tutorial.

Once you have installed VS Code, these topics will help you learn more about it:

Azure VM Issues

I’m getting a «Running without the SUID sandbox» error?

You can safely ignore this error.

Debian and moving files to trash

If you see an error when deleting files from the VS Code Explorer on the Debian operating system, it might be because the trash implementation that VS Code is using is not there.

Run these commands to solve this issue:

Conflicts with VS Code packages from other repositories

Some distributions, for example Pop!_OS provide their own code package. To ensure the official VS Code repository is used, create a file named /etc/apt/preferences.d/code with the following content:

«Visual Studio Code is unable to watch for file changes in this large workspace» (error ENOSPC)

The limit can be increased to its maximum by editing /etc/sysctl.conf (except on Arch Linux, read below) and adding this line to the end of the file:

While 524,288 is the maximum number of files that can be watched, if you’re in an environment that is particularly memory constrained, you may want to lower the number. Each file watch takes up 1080 bytes, so assuming that all 524,288 watches are consumed, that results in an upper bound of around 540 MiB.

Arch-based distros (including Manjaro) require you to change a different file; follow these steps instead.

I can’t see Chinese characters in Ubuntu

Package git is not installed

This error can appear during installation and is typically caused by the package manager’s lists being out of date. Try updating them and installing again:

The code bin command does not bring the window to the foreground on Ubuntu

Under General > General Options > Focus & Raise Behaviour, set «Focus Prevention Level» to «Off». Remember this is an OS-level setting that will apply to all applications, not just VS Code.

This can happen when sources.list.d doesn’t exist or you don’t have access to create the file. To fix this, try manually creating the folder and an empty vscode.list file:

Cannot move or resize the window while X forwarding a remote window

Using the custom title bar

The custom title bar and menus were enabled by default on Linux for several months. The custom title bar has been a success on Windows, but the customer response on Linux suggests otherwise. Based on feedback, we have decided to make this setting opt-in on Linux and leave the native title bar as the default.

The custom title bar provides many benefits including great theming support and better accessibility through keyboard navigation and screen readers. Unfortunately, these benefits do not translate as well to the Linux platform. Linux has a variety of desktop environments and window managers that can make the VS Code theming look foreign to users. For users needing the accessibility improvements, we recommend enabling the custom title bar when running in accessibility mode using a screen reader. You can still manually set the title bar with the Window: Title Bar Style ( window.titleBarStyle ) setting.

Broken cursor in editor with display scaling enabled

Repository changed its origin value

If you receive an error similar to the following:

Use apt instead of apt-get and you will be prompted to accept the origin change:

Using C++ on Linux in VS Code

In this tutorial, you will configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger on Linux. GCC stands for GNU Compiler Collection; GDB is the GNU debugger.

After configuring VS Code, you will compile and debug a simple C++ program in VS Code. This tutorial does not teach you GCC, GDB, Ubuntu or the C++ language. For those subjects, there are many good resources available on the Web.

If you have trouble, feel free to file an issue for this tutorial in the VS Code documentation repository.

Prerequisites

To successfully complete this tutorial, you must do the following:

Install the C++ extension for VS Code. You can install the C/C++ extension by searching for ‘c++’ in the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Ensure GCC is installed

Although you’ll use VS Code to edit your source code, you’ll compile the source code on Linux using the g++ compiler. You’ll also use GDB to debug. These tools are not installed by default on Ubuntu, so you have to install them. Fortunately, that’s easy.

First, check to see whether GCC is already installed. To verify whether it is, open a Terminal window and enter the following command:

If GCC isn’t installed, run the following command from the terminal window to update the Ubuntu package lists. An out-of-date Linux distribution can sometimes interfere with attempts to install new packages.

Next install the GNU compiler tools and the GDB debugger with this command:

Create Hello World

Add hello world source code file

Paste in the following source code:

Now press ⌘S (Windows, Linux Ctrl+S ) to save the file. Notice that your files are listed in the File Explorer view ( ⇧⌘E (Windows, Linux Ctrl+Shift+E ) ) in the side bar of VS Code:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can also enable Auto Save to automatically save your file changes, by checking Auto Save in the main File menu.

The Activity Bar on the edge of Visual Studio Code lets you open different views such as Search, Source Control, and Run. You’ll look at the Run view later in this tutorial. You can find out more about the other views in the VS Code User Interface documentation.

Note: When you save or open a C++ file, you may see a notification from the C/C++ extension about the availability of an Insiders version, which lets you test new features and fixes. You can ignore this notification by selecting the X (Clear Notification).

Explore IntelliSense

In the helloworld.cpp file, hover over vector or string to see type information. After the declaration of the msg variable, start typing msg. as you would when calling a member function. You should immediately see a completion list that shows all the member functions, and a window that shows the type information for the msg object:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can press the Tab key to insert the selected member. Then, when you add the opening parenthesis, you’ll see information about arguments that the function requires.

Run helloworld.cpp

Remember, the C++ extension uses the C++ compiler you have installed on your machine to build your program. Make sure you have a C++ compiler installed before attempting to run and debug helloworld.cpp in VS Code.

Open helloworld.cpp so that it is the active file.

Press the play button in the top right corner of the editor.

Choose g++ build and debug active file from the list of detected compilers on your system.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After the build succeeds, your program’s output will appear in the integrated Terminal.

Your new tasks.json file should look similar to the JSON below:

Note: You can learn more about tasks.json variables in the variables reference.

The command setting specifies the program to run; in this case that is g++. The args array specifies the command-line arguments that will be passed to g++. These arguments must be specified in the order expected by the compiler.

The label value is what you will see in the tasks list; you can name this whatever you like.

The detail value is what you will as the description of the task in the tasks list. It’s highly recommended to rename this value to differentiate it from similar tasks.

Modifying tasks.json

Debug helloworld.cpp

Explore the debugger

Before you start stepping through the code, let’s take a moment to notice several changes in the user interface:

The Integrated Terminal appears at the bottom of the source code editor. In the Debug Output tab, you see output that indicates the debugger is up and running.

The editor highlights line 12, which is a breakpoint that you set before starting the debugger:

The Run and Debug view on the left shows debugging information. You’ll see an example later in the tutorial.

At the top of the code editor, a debugging control panel appears. You can move this around the screen by grabbing the dots on the left side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you already have a launch.json file in your workspace, the play button will read from it when figuring out how run and debug your C++ file. If you don’t have launch.json, the play button will create a temporary “quick debug” configuration on the fly, eliminating the need for launch.json altogether!

Step through the code

Now you’re ready to start stepping through the code.

Click or press the Step over icon in the debugging control panel.

This will advance program execution to the first line of the for loop, and skip over all the internal function calls within the vector and string classes that are invoked when the msg variable is created and initialized. Notice the change in the Variables window on the side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Press Step over again to advance to the next statement in this program (skipping over all the internal code that is executed to initialize the loop). Now, the Variables window shows information about the loop variables.

Press Step over again to execute the cout statement. (Note that as of the March 2019 release, the C++ extension does not print any output to the Debug Console until the last cout executes.)

If you like, you can keep pressing Step over until all the words in the vector have been printed to the console. But if you are curious, try pressing the Step Into button to step through source code in the C++ standard library!

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

When the loop has completed, you can see the output in the Debug Console tab of the integrated terminal, along with some other diagnostic information that is output by GDB.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Set a watch

To keep track of the value of a variable as your program executes, set a watch on the variable.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To quickly view the value of any variable while execution is paused on a breakpoint, you can hover over it with the mouse pointer.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Next, you’ll create a tasks.json file to tell VS Code how to build (compile) the program. This task will invoke the g++ compiler to create an executable file from the source code.

It’s important to have helloworld.cpp open in the editor because the next step uses the active file in the editor for context to create the build task in the next step.

Customize debugging with launch.json

There are cases where you’d want to customize your debug configuration, such as specifying arguments to pass to the program at runtime. You can define custom debug configurations in a launch.json file.

You’ll then see a dropdown for various predefined debugging configurations. Choose g++ build and debug active file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

VS Code creates a launch.json file, which looks something like this:

Change the stopAtEntry value to true to cause the debugger to stop on the main method when you start debugging.

From now on, the play button and F5 will read from your launch.json file when launching your program for debugging.

C/C++ configurations

If you want more control over the C/C++ extension, you can create a c_cpp_properties.json file, which will allow you to change settings such as the path to the compiler, include paths, C++ standard (default is C++17), and more.

You can view the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path.

Reusing your C++ configuration

Как установить Visual Studio Code на Ubuntu

В этой статье мы рассмотрим, как установить Visual Studio Code на Ubuntu 18.04 или более поздних версий. Для этого лучше всего использовать официальный репозиторий от Microsoft. Однако можно также воспользоваться snap-пакетом или центром приложений Ubuntu.

Установка Visual Studio Code на Ubuntu

Для работы репозитория нужно установить несколько пакетов. Для этого выполните команду:

sudo apt install software-properties-common apt-transport-https wget

Затем установите ключ репозитория:

И добавьте сам репозиторий:

sudo add-apt-repository «deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main»

После этого остается обновить списки пакетов и установить VS Code:

sudo apt update
sudo apt install code

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

После завершения установки вы можете запустить программу, выполнив в терминале команду code, или через главное меню системы:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Главное окно программы будет выглядеть вот так:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Также можно установить программу с помощью менеджера пакетов snap. Для этого выполните:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

А ещё программа есть в центре приложений Ubuntu:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Удаление Visual Studio Code в Ubuntu

Удалять программу надо так, как вы её устанавливали. Если установка Visual Studio Code Ubuntu 18.04 выполнялась из репозитория Microsoft, то для удаления выполните:

sudo apt purge code

Затем можно отключить репозиторий с помощью утилиты Программы и обновления:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

А если установка выполнялась через менеджер пакетов snap или центр приложений, то для удаления достаточно выполнить:

sudo snap remove code

Выводы

Теперь у вас есть успешно установленная VS Code Ubuntu 18.04, и вы можете переходить к её настройке, а затем к программированию. Далее вам нужно настроить внешний вид среды, а также установить необходимые дополнения. Но об этом поговорим в следующих статьях.

Get started using Visual Studio Code with Windows Subsystem for Linux

Install VS Code and the Remote WSL extension

Visit the VS Code install page and select the 32 or 64 bit installer. Install Visual Studio Code on Windows (not in your WSL file system).

When prompted to Select Additional Tasks during installation, be sure to check the Add to PATH option so you can easily open a folder in WSL using the code command.

Update your Linux distribution

Some WSL Linux distributions are lacking libraries that are required by the VS Code server to start up. You can add additional libraries into your Linux distribution by using its package manager.

For example, to update Debian or Ubuntu, use:

To add wget (to retrieve content from web servers) and ca-certificates (to allow SSL-based applications to check for the authenticity of SSL connections), enter:

Open a WSL project in Visual Studio Code

From the command-line

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

From VS Code

You can also access more VS Code Remote options by using the shortcut: CTRL+SHIFT+P in VS Code to bring up the command palette. If you then type Remote-WSL you will see a list of the VS Code Remote options available, allowing you to reopen the folder in a remote session, specify which distribution you want to open in, and more.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensions inside of VS Code Remote

The Remote-WSL extension splits VS Code into a “client-server” architecture, with the client (the user interface) running on your Windows machine and the server (your code, Git, plugins, etc) running remotely.

When running VS Code Remote, selecting the ‘Extensions’ tab will display a list of extensions split between your local machine and your WSL distribution.

Installing a local extension, like a theme, only needs to be installed once.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

For further information, see the VS Code docs:

When VS Code Remote is started in WSL, no shell startup scripts are run. See this advanced environment setup script article for more info on how to run additional commands or modify the environment.

Having problems launching VS Code from your WSL command line? This troubleshooting guide includes tips on changing path variables, resolving extension errors about missing dependencies, resolving Git line ending issues, installing a local VSIX on a remote machine, launching a browser window, blocker localhost port, web sockets not working, errors storing extension data, and more.

Install Git (optional)

If you plan to collaborate with others, or host your project on an open-source site (like GitHub), VS Code supports version control with Git. The Source Control tab in VS Code tracks all of your changes and has common Git commands (add, commit, push, pull) built right into the UI.

Install Windows Terminal (optional)

The new Windows Terminal enables multiple tabs (quickly switch between Command Prompt, PowerShell, or multiple Linux distributions), custom key bindings (create your own shortcut keys for opening or closing tabs, copy+paste, etc.), emojis ☺, and custom themes (color schemes, font styles and sizes, background image/blur/transparency). Learn more in the Windows Terminal docs.

Get Windows Terminal in the Microsoft Store: By installing via the store, updates are handled automatically.

Once installed, open Windows Terminal and select Settings to customize your terminal using the profile.json file.

Additional Resources

A few additional extensions you may want to consider include:

Visual Studio Code

Contents

Installation

The following flavors of Visual Studio Code are available:

Extensions support

Known workarounds are:

Usage

Run code to start the application (or if you are using other releases, run code-git for code-git AUR or codium for vscodium-bin AUR / vscodium AUR / vscodium-git AUR ).

Configuration

code stores settings in

vscodium AUR and related packages store their settings in

When migrating from Code to Codium (or vice versa), the settings directory can be copied or moved, since they share most of their codebase, the settings are compatible.

Integrated Terminal

View > Integrated Terminal or Ctrl + ` opens up an integrated terminal. By default, Bash is used with no additional arguments, although this can be changed. terminal.integrated.shell.linux sets the default shell to be used and terminal.integrated.shellArgs.linux sets the arguments to be passed to the shell.

You might face weird prompts after setting the integrated shell arguments with an external terminal. Remove the line to solve the problem or use an external terminal.

External terminal

«terminal.external.linuxExec»: «Your alternative terminal» sets the default terminal to be used for exec debug.

Running natively under Wayland

Visual Studio code uses Electron, see Wayland#Electron for more information on how to run it natively under Wayland.

Troubleshooting

Global menu not working in KDE/Plasma

Unable to move items to trash

By default, Electron applications use gio to delete files. kioclient5 is automatically selected instead if Plasma is detected. Different trash implementations can be used by setting the ELECTRON_TRASH environment variable.

For example, for deleting files using trash-cli :

Unable to debug C#

When using the open-source package, debugging fails fairly quietly. The debug console will just show the initial message:

You have to switch from mono to proper SDK version props.

Modify import to look like this:

Error from OmniSharp that MSBuild cannot be located

It is noted in the OmniSharp introduction that Arch Linux users should install the mono-msbuild package. Without it, you might get an error like:

You might be able to build anyway (possibly depending whether you have mono installed too).

Omnisharp ships with its own mono version, so, if it is unable to locate the installed one, if you want to tell omnisharp to look for a «global» mono installed in your machine, put this in your settings.json:

Saving with «Retry as Sudo» does not work

This feature does not work in the code package, because Microsoft does not support the way the Arch package is packaged (native instead of bundled Electron). See FS#61516 and the upstream bug report for more information.

The binary release visual-studio-code-bin AUR does not have this issue, and the feature works there.

Keyboard variants or keymappings do not map

Switching keyboard layouts under some Linux window managers does not result in a change in the low level X window APIs VS Code uses to read the current keyboard layout. This means that VS Code ends up sometimes reading one of the other configured keyboard layouts and not the current active one. PR welcome.

Per the wiki, there are two possible solutions:

Command «. » not found

This issue can be resolved by installing a Pacman hook that patches the file on every package update:

You can also manually add the relevant entries to the extensionAllowedProposedApi section in the product.json file:

An example of a manual configuration that would make Live Share work is [3]:

Finally, you can also enable these options using command line flags, as described for the GitHub pull request extension.

VS Live Share missing API

Also note that for this extension to work, you need to install dependencies listed here [4].

Command ‘remote-containers.openFolder’ not found

Open VS Code enabling remote-containers API as commented in FS#63374:

Command ‘GitHub Pull Requests: Configure Remotes. ‘ resulted in an error (command ‘pr.configureRemotes’ not found)

Open VS Code with:

Git: ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory

This error is a result of an encrypted ssh-key and inability to use ssh agent, see bug report. The issue can be solved by installing a dialogue provider like SSH keys#x11-ssh-askpass or the alternatives listed there like ksshaskpass for KDE.

One thing to note is that for e.g. ksshaskpass you would need to link it from /usr/lib/ssh/ssh-askpass to get VSCode to find it:

Cutoff characters in integrated Terminal

Characters that are too wide can end up clipping. For example the italic bold text of Deno stack-traces.

This can be avoided by setting «terminal.integrated.rendererType» to «experimentalWebgl».

Blurry text under Wayland

Visual Studio Code defaults to run under XWayland, which may cause blurry text if you are using HiDPI screens. To fix this issue, try forcing Electron to run under Wayland—see #Running natively under Wayland.

No such interface“org.freedesktop.Secret.Collection”

Authentification with Github failed while using VSCodium

When connecting a Github account, change «vscodium» to «vscode» in the URL as seen in this comment. Then copy the identification token into VSCodium. Should it still fail, install a keyring like gnome-keyring or create a new keyring as mentioned here in the Visual Studio Code docs and here on Github.

С/С++ на Linux в Visual Studio Code для начинающих

Давайте начистоту, мало кто использует отладчик GDB на Linux в консольном варианте. Но что, если добавить в него красивый интерфейс? Под катом вы найдёте пошаговую инструкцию отладки кода С/С++ на Linux в Visual Studio Code.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Передаю слово автору.

Относительно недавно я переехал на Linux. Разрабатывать на Windows, конечно, удобнее и приятнее, но и здесь я нашел эффективный способ легко и быстро отлаживать код на С/С++, не прибегая к таким методам как «printf-стайл отладки» и так далее.

Итак приступим. Писать в sublime (или gedit/kate/emacs ), а запускать в терминале — так себе решение, ошибку при работе с динамическим распределением памяти вряд ли найдёшь с первого раза. А если проект трудоёмкий? У меня есть более удобное решение. Да и ещё поддержка Git в редакторе, одни плюсы.

Сегодня мы поговорим про Visual Studio Code.

Установка

/Загрузки или cd

OpenSUSE/SLE Based distrs

Расширения для С/С++

Чтобы VS Code полностью сопровождал нас при работе с файлами С/С++, нужно установить расширение «cpptools». Также полезным будет поставить один из наборов сниппетов.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Настоятельно рекомендую включить автосохранение редактируемых файлов, это поможет нам в дальнейшем.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Идём дальше. Открываем любую папку (новую или нет, неважно).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

У меня в этой папке уже есть пара файлов для работы с C/C++. Вы можете скопировать одну из своих наработок сюда или создать новый файл.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Шаг 2. Нажимаем Ctrl+Shift+B. VS Code вам мягко намекнет, что он не знает как собирать ваш проект.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Шаг 6. Далее возвращаемся обратно к нашему исходнику. И нажимаем F5 и выбираем C++.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Шаг 8. Всё, больше нам не нужно ничего для начала использования всех благ VS Code. Переходим к основному проекту.

Отладка

Для начала скомпилируем программу (нет, нет, убери терминал, теперь это делается по нажатию Ctrl+Shift+B).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Пришло время для брейкпоинтов. Выберем строчку с «return 0;» и нажимаем F9.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Строчка, помеченная красной точкой слева — место, где остановится программа, при выполнении.

Далее нажимаем F5.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Как я и сказал, программа остановила выполнение. Обратите внимание на окно с локальными переменными.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Удобненько. Также при остановке можно наводить мышкой на переменные и структуры в коде и смотреть их значения.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Также, если на каком-то этапе выполнения вам нужно посмотреть пошаговое выполнение той или иной операции, например в цикле, то поставьте брейкпоинт перед ней и нажмите F10 для выполнения текущей строчки без захода в подпрограмму и F11 с заходом.

Также есть случаи, когда считать выражение очень муторно вручную, но для отладки вам нужно знать, например, значение суммы трех элементов массива, или значение большого логического выражения. Для этого существуют контрольные значения. Все это и многое другое могут показать вам Контрольные значения (или «watch»).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

How to install Visual Studio Code on Linux?

I have just downloaded VSCode-linux-x64 from the Microsoft website. It’s a zip file called VSCode-linux-x64.zip. How can I install it on my Linux system?

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

5 Answers 5

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

From a few pages deeper into the setup docs in the link you offered.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extract the zip file VSCode-linux-x64.zip

Go inside the folder VSCode-linux-x64

You can right click on Visual Studio Code on toolbar (or launcher)
and select Lock to Launcher. this way you can launch the editor by
clicking it on launcher.

If you are using terminal follow the terminal commands

This video will help you to download and install and use Visual Studio Code on Ubuntu if you still have some doubts

After 18.04 version, the following one-line terminal code works well.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Installing with apt-get:

Step 1 – Enable Package Repository

Run the following command to enable Visual studio code repository to your system:

Step 2 – Install Visual Studio Code Editor

Now, Import the package signing gpg key on your system using the following command:

Install Visual Studio Code on your Debian based system (like Ubuntu):

Step 3 – Launch Visual Studio Code and enable its extensions:

Now You can launch the Visual Studio Code editor on your system using the graphical menu.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

There are a large number of extensions available for Visual Studio Code like PHP, Python, JavaScript etc. Install the required extensions to enhance your working experience with Visual Studio Code.

How to Install Visual Studio Code on Linux

Developed by Microsoft, Visual Studio Code is a free and open-source, cross-platform IDE or code editor that enables developers to develop applications and write code using a myriad of programming languages such as C, C++, Python, Go and Java to mention a few.

In this guide, we will walk you through the installation of the Visual Studio Code on Linux. To be more specific, you will learn how to install the Visual Studio Code on both Debian-based and RedHat-based Linux distributions.

On this page:

How to Install Visual Studio Code on Debian, Ubuntu and Linux Mint

The most preferred method of installing Visual Code Studio on Debian based systems is by enabling the VS code repository and installing the Visual Studio Code package using the apt package manager.

Once updated, proceed and install dependencies required by executing.

Next, using the wget command, download the repository and import Microsoft’s GPG key as shown:

Once you’ve enabled the repository, update the system and install Visual Studio Code by running the command:

Due to its size, the installation takes approximately 5 minutes. Once installed, use the application manager to search Visual Code Studio and launch it as shown.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux Install Visual Studio Code in Ubuntu

How to Install Visual Studio Code on CentOS, RHEL, and Fedora

The procedure of installing Visual Studio Code on RedHat based distributions is pretty much like Ubuntu. Right off the bat, launch your terminal and update your system:

Next, import Microsoft’s GPG key using the rpm command below:

With Microsoft’s GPG key in place, proceed and create the repository file for Visual Studio Code:

Next, append the code below and save the file:

To install Visual Studio code, run the command:

To use it, use the Application manager to search the Visual Studio Code and launch it, you will get a window as shown below.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux Install Visual Studio Code in CentOS

You can now proceed and start writing your code and installing your preferred extensions.

Conclusion

Visual Studio Code is a powerful and feature-rich code editor that allows you to develop applications in a diverse array of programming languages. It’s especially popular with Python and C programmers. In this topic, we walked you through the installation of the Visual Studio Code on Linux.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

We are thankful for your never ending support.

ASP.NET Core: ваше первое приложение на Linux c использованием Visual Studio Code

Решил недавно написать небольшое ASP.Net MVC приложение после многолетнего перерыва и знающие люди на Хабре подсказали попробовать новый ASP.Net Core, тем более, что он работает в Линуксе из коробки без необходимости задействовать mono, и, судя по последним тестам, даже показывает неплохую производительность. За основу взял аналогичную статью для Mac, однако здесь в отличии от вдохновившей меня статьи хочу описать процесс пошагово в одном месте, для того, чтобы не пришлось лазить по перекрёстным ссылкам, пытаясь разобраться как установить непонятно для чего предназначенные приложения и пакеты. Такое подробное описание процесса возможно поможет многим избежать граблей, с которыми пришлось столкнуться мне. Несколько фраз и рисунков, в части одинаковой для любой платформы, с правками и корректировками взяты из статьи для Mac.

Приводимые здесь команды установки подходят для дистрибутивов Ubuntu 16.04/Mint 18.x, для остальных можно найти здесь.

Устанавливаем новейший на данный момент RC4 для совместимости с новейшим генератором проектов aspnet:

Установка Visual Studio Code

Устанавливается легко в пару кликов по этой ссылке.

Установка расширения C#

Запускаем Visual Studio Code, нажимаем Ctrl-P, вводим команду:
ext install csharp

В появившейся слева панели нажимаем «Установить» напротив соответствующего расширения, если это не произошло автоматически. Visual Studio Code можно пока закрыть.

Подготовка среды разработки и формирование шаблонов приложений

Устанавливаем новейший node.js с оригинального сайта (тот, что идёт с дистрибутивом не подходит), он нам нужен из-за менеджера пакетов npm, который идёт вместе с ним:
Для других дистрибутивов инструкция здесь.

Инициализация проекта

Для инициализации используется скаффолдер Yeoman — инициализатор проекта, включающий в себя развёртывание файловой структуры и генерацию шаблона проекта, т.е. исходного кода приложения. Включает в себя скаффолдер Yo, менеджер пакетов Bower и менеджер задач Grunt. При установке Yo вам будут установлены также Bower и Grunt. Здесь устанавливаем в любом терминале также новейший генератор aspnet, в котором возвращена система сборки msbuild вместо project.json:

Запуск генератора проекта

Your project is now created, you can use the following commands to get going
cd «WebApplicationBasic»
dotnet restore
dotnet build (optional, build will also happen with it’s run)
dotnet run

Восстановить и собрать можно, а вот запускать пока рано: нужно ещё кое что сделать.

Разработка приложений ASP.NET Core MVC на Linux с помощью Visual Studio Code

Теперь запустите Visual Studio Code.
Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux
Выберите пункт Файл → Отрыть папку и выберите папку, в которой Вы создали шаблон приложения ASP.NET Core MVC с помощью yo.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Для тех, кто только приступает к использованию Visual Studio Code (или Code, для краткости), следует заметить, что данный продукт не только имеет удобный, простой и отзывчивый интерфейс, обеспечивающий быструю работу с файлами, но он также предоставляет инструменты для наиболее эффективного написания кода.

Code интегрируется с Git, если он установлен на вашем компьютере. При помощи Git viewlet можно создавать новые репозитории, подтверждать изменение кода, отправлять изменения.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debug viewlet поддерживает интерактивную отладку приложений.

Запуск приложения при помощи Kestrel

Visual Studio Code (Русский)

Contents

Установка

Редактор VSCode доступен для установки с помощью следующих пакетов:

Поддержка расширений

Использование Microsoft marketplace для расширений ограничено продуктами семейства Visual Studio Code. Следовательно, он не может быть использован в Code-OSS (смотрите FS#67780).

Пакеты code и vscodium-bin AUR / vscodium AUR / vscodium-git AUR настроены на использование Open VSX registry, поддерживаемого Eclipse Foundation. Это объясняет, почему Code-OSS не может найти некоторые расширения.

Известные способы решения проблемы следующие:

Использование

Настройка

Пакет code хранит конфигурацию в файле

Пакет visual-studio-code-bin AUR хранит конфигурацию в файле

vscodium AUR и связанные пакеты хранят конфигурацию в файле

При миграции с Code на Codium (или наоборот) каталог настроек может быть скопирован или перемещён, поскольку они имеют общую кодовую базу и настройки совместимы.

Встроенный терминал

Меню Вид > Терминал или Ctrl + ` открывает встроенный терминал. По умолчанию используется Bash без каких-либо параметров, но настройки, указанные далее позволяют изменить данное взаимодействие.

Например, установить по умолчанию fish с параметрами.

Вы можете столкнуться со странными запросами при установке встроенного терминала, удалением некоторых строк, поэтому рекомендуется либо не использовать аргументы, либо использовать внешний терминал.

Внешний терминал

Строка настроек «terminal.external.linuxExec»: «имя терминала» установит терминал на требуемый. Пример установки gnome-terminal :

Решение проблем

Глобальное меню не работает в KDE Plasma

Невозможно переместить объект в корзину

Например, для удаления с помощью trash-cli :

Невозможно отладить C#

Если вы используете свободный пакет, отладка упадёт почти незаметно, лишь оставив в консоли сообщение:

Требуется сменить путь к SDK. Вот, как выглядит файл до изменений.

Вот, как выглядит файл после изменения.

OmniSharp не может обнаружить MSBuild

Возможно, потребуется собрать пакет самостоятельно.

Omnisharp поставляется со своей собственной версией mono, поэтому, если он не может найти установленную версию, если вы хотите сказать omnisharp искать «глобальный» mono, установленный на вашей машине, поместите это в ваш settings.json:

«Повторить попытку в режиме Sudo» не работает

К сожалению, пакет code не поддерживает эту функцию в полной мере, так как официально Microsoft не поддерживает пакет для Arch Linux. Смотри также FS#61516 или тикет на GitHub.

Проблемы с сопоставлением клавиш

Переключение раскладок клавиатуры в некоторых оконных менеджерах Linux не приводит к обновлению низкоуровневых оконных API X, которые VS Code использует для получения текущей раскладки клавиатуры. Это означает, что VS Code иногда считывает одну из других настроенных раскладок клавиатуры, а не текущую активную.

Согласно вики, есть два возможных решения:

Команда «. » не найдена

В официальной сборке VS Code есть файл product.json со списком расширений, которым разрешено использовать определённые API. Однако этого файла нет в OSS-сборке code [1]

Для включения определённых API могут потребоваться некоторые флаги. [2] Вы можете либо запустить code с этими флагами, либо добавить соответствующие записи в раздел extensionAllowedProposedApi в файле product.json (пакет code устанавливает его в /usr/lib/code/product.json ).

VS Live Share missing API

Команда ‘remote-containers.openFolder’ не найдена

Для решения проблемы требуется открыть VS Code со включённым API remote-containers (см. баг FS#63374)

Command ‘GitHub Pull Requests: Configure Remotes. ‘ resulted in an error (command ‘pr.configureRemotes’ not found)

Запустите VS Code с опцией:

Git: ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory

Эта ошибка возникает из-за зашифрованного ssh-ключа, и её можно решить, установив какой-нибудь провайдер диалога, например SSH keys#x11-ssh-askpass или альтернативы, перечисленные там, например ksshaskpass для KDE.

Обрезанные символы во встроенном терминале

Слишком широкие символы могут обрезаться. Например, курсивный полужирный текст в стек-трейсах Deno.

Этого можно избежать, установив для параметра «terminal.integrated.rendererType» значение «experimentalWebgl».

No such interface“org.freedesktop.Secret.Collection”

Аутентификация на Github через VSCodium не работает

При подключении аккаунта Github измените «vscodium» на «vscode» в URL, как показано в этом комментарии. Затем скопируйте идентификационный токен в VSCodium.

Внешний вид диалога выбора файла не согласован с внешним видом системы

На данный момент vscodium использует диалог gtk даже в kde. Смотрите Единый вид приложений Qt и GTK#Согласованный диалог выбора файлов для более подробной информации.

Using C++ and WSL in VS Code

In this tutorial, you will configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger on Ubuntu in the Windows Subsystem for Linux (WSL). GCC stands for GNU Compiler Collection; GDB is the GNU debugger. WSL is a Linux environment within Windows that runs directly on the machine hardware, not in a virtual machine.

Note: Much of this tutorial is applicable to working with C++ and VS Code directly on a Linux machine.

After completing this tutorial, you will be ready to create and configure your own C++ project, and to explore the VS Code documentation for further information about its many features. This tutorial does not teach you about GCC or Linux or the C++ language. For those subjects, there are many good resources available on the Web.

If you have any problems, feel free to file an issue for this tutorial in the VS Code documentation repository.

Prerequisites

To successfully complete this tutorial, you must do the following steps:

Install Windows Subsystem for Linux and then use the links on that same page to install your Linux distribution of choice. This tutorial uses Ubuntu. During installation, remember your Linux user password because you’ll need it to install additional software.

Set up your Linux environment

Open the Bash shell for WSL. If you installed an Ubuntu distro, type «Ubuntu» in the Windows search box and then click on it in the result list. For Debian, type «Debian», and so on.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The shell appears with a command prompt that by default consists of your user name and computer name, and puts you in your home directory. For Ubuntu it looks like this:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Make a directory called projects and then subdirectory under that called helloworld :

Although you will be using VS Code to edit your source code, you’ll be compiling the source code on Linux using the g++ compiler. You’ll also debug on Linux using GDB. These tools are not installed by default on Ubuntu, so you have to install them. Fortunately, that task is quite easy!

From the WSL command prompt, first run apt-get update to update the Ubuntu package lists. An out-of-date distro can sometimes interfere with attempts to install new packages.

If you like, you can run sudo apt-get update && sudo apt-get dist-upgrade to also download the latest versions of the system packages, but this can take significantly longer depending on your connection speed.

From the command prompt, install the GNU compiler tools and the GDB debugger by typing:

Verify that the install succeeded by locating g++ and gdb. If the filenames are not returned from the whereis command, try running the update command again.

Note: The setup steps for installing the g++ compiler and GDB debugger apply if you are working directly on a Linux machine rather than in WSL. Running VS Code in your helloworld project, as well as the editing, building, and debugging steps are the same.

Run VS Code in WSL

You’ll see a message about «Installing VS Code Server». VS Code is downloading and installing a small server on the Linux side that the desktop VS Code will then talk to. VS Code will then start and open the helloWorld folder. The File Explorer shows that VS Code is now running in the context of WSL with the title bar WSL: Ubuntu.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can also tell the remote context from the Status bar.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Add a source code file

Install the C/C++ extension

Once you create the file and VS Code detects it is a C++ language file, you may be prompted to install the Microsoft C/C++ extension if you don’t already have it installed.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Choose Install and then Reload Required when the button is displayed in the Extensions view to complete installing the C/C++ extension.

If you already have C/C++ language extensions installed locally in VS Code, you’ll need to go to the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ) and install those extensions into WSL. Locally installed extensions can be installed into WSL by selecting the Install in WSL button and then Reload Required.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Add hello world source code

Now paste in this source code:

Now press ⌘S (Windows, Linux Ctrl+S ) to save the file. Notice how the file you just added appears in the File Explorer view ( ⇧⌘E (Windows, Linux Ctrl+Shift+E ) ) in the side bar of VS Code:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can also enable Auto Save to automatically save your file changes, by checking Auto Save in the main File menu.

The Activity Bar on the far left lets you open different views such as Search, Source Control, and Run. You’ll look at the Run view later in this tutorial. You can find out more about the other views in the VS Code User Interface documentation.

Explore IntelliSense

In your new helloworld.cpp file, hover over vector or string to see type information. After the declaration of the msg variable, start typing msg. as you would when calling a member function. You should immediately see a completion list that shows all the member functions, and a window that shows the type information for the msg object:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can press the Tab key to insert the selected member; then, when you add the opening parenthesis, you will see information about any arguments that the function requires.

Run helloworld.cpp

Remember, the C++ extension uses the C++ compiler you have installed on your machine to build your program. Make sure you have a C++ compiler installed before attempting to run and debug helloworld.cpp in VS Code.

Open helloworld.cpp so that it is the active file.

Press the play button in the top right corner of the editor.

Choose g++ build and debug active file from the list of detected compilers on your system.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After the build succeeds, your program’s output will appear in the integrated Terminal.

Your new tasks.json file should look similar to the JSON below:

Note: You can learn more about tasks.json variables in the variables reference.

The command setting specifies the program to run; in this case that is g++. The args array specifies the command-line arguments that will be passed to g++. These arguments must be specified in the order expected by the compiler.

The label value is what you will see in the tasks list; you can name this whatever you like.

The detail value is what you will as the description of the task in the tasks list. It’s highly recommended to rename this value to differentiate it from similar tasks.

Modifying tasks.json

Debug helloworld.cpp

Explore the debugger

Before you start stepping through the code, let’s take a moment to notice several changes in the user interface:

The Integrated Terminal appears at the bottom of the source code editor. In the Debug Output tab, you see output that indicates the debugger is up and running.

The editor highlights line 12, which is a breakpoint that you set before starting the debugger:

The Run and Debug view on the left shows debugging information. You’ll see an example later in the tutorial.

At the top of the code editor, a debugging control panel appears. You can move this around the screen by grabbing the dots on the left side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you already have a launch.json file in your workspace, the play button will read from it when figuring out how run and debug your C++ file. If you don’t have launch.json, the play button will create a temporary “quick debug” configuration on the fly, eliminating the need for launch.json altogether!

Step through the code

Now you’re ready to start stepping through the code.

Click or press the Step over icon in the debugging control panel.

This will advance program execution to the first line of the for loop, and skip over all the internal function calls within the vector and string classes that are invoked when the msg variable is created and initialized. Notice the change in the Variables window on the side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Press Step over again to advance to the next statement in this program (skipping over all the internal code that is executed to initialize the loop). Now, the Variables window shows information about the loop variables.

Press Step over again to execute the cout statement. (Note that as of the March 2019 release, the C++ extension does not print any output to the Debug Console until the last cout executes.)

If you like, you can keep pressing Step over until all the words in the vector have been printed to the console. But if you are curious, try pressing the Step Into button to step through source code in the C++ standard library!

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

When the loop has completed, you can see the output in the Debug Console tab of the integrated terminal, along with some other diagnostic information that is output by GDB.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Set a watch

To keep track of the value of a variable as your program executes, set a watch on the variable.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To quickly view the value of any variable while execution is paused on a breakpoint, you can hover over it with the mouse pointer.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Next, you’ll create a tasks.json file to tell VS Code how to build (compile) the program. This task will invoke the g++ compiler to create an executable file from the source code.

It’s important to have helloworld.cpp open in the editor because the next step uses the active file in the editor for context to create the build task in the next step.

Customize debugging with launch.json

There are cases where you’d want to customize your debug configuration, such as specifying arguments to pass to the program at runtime. You can define custom debug configurations in a launch.json file.

You’ll then see a dropdown for various predefined debugging configurations. Choose g++ build and debug active file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

VS Code creates a launch.json file, which looks something like this:

Change the stopAtEntry value to true to cause the debugger to stop on the main method when you start debugging.

From now on, the play button and F5 will read from your launch.json file when launching your program for debugging.

C/C++ configurations

If you want more control over the C/C++ extension, you can create a c_cpp_properties.json file, which will allow you to change settings such as the path to the compiler, include paths, C++ standard (default is C++17), and more.

You can view the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path.

Closing the WSL session

When you are done working in WSL, you can close your remote session with the Close Remote Connection command available in the main File menu and the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ). This will restart VS Code running locally. You can easily reopen your WSL session from the File > Open Recent list by selecting folders with the [WSL] suffix.

Remote development in WSL

Prerequisites

Install the extension

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Prerequisite check

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Enable WSL

Windows Subsystem for Linux (WSL) is an optional feature on Windows 10. You can enable it through the Windows Features dialog or PowerShell.

Windows Features dialog

In the Windows search bar, type ‘features’ to bring up the Turn Windows Features on and off dialog. Scroll down and check Windows Subsystem for Linux.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select OK and you will be prompted to restart Windows.

PowerShell

If you prefer, you can open PowerShell as an Administrator and type:

After the command runs, you will be prompted to restart Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Check WSL

After restarting Windows, you can check that you have WSL enabled by opening a Command Prompt and typing ‘wsl’.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

WSL is enabled, but you haven’t installed a Linux distribution yet.

Install a Linux distro

You install Linux distributions for WSL from the Microsoft Store. You can use the store app, or search for a Linux distro in the Windows search bar. Choose the Linux distribution you want to install (for example Ubuntu) and follow the prompts.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select Install.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

And when done, select Launch to get started. This will open a Linux terminal and complete the installation. You’ll need to create a user ID and password since you are setting up a full Linux instance. You are now running Linux on Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Python development

If you don’t have Python already installed, run the following commands to install Python3 and pip, the package manager for Python, into your Linux installation.

And to verify, run:

Start with the canonical «Hello World» app. Create a new folder called «helloWorld» and then add a Python file that will print a message when run:

In a remote Linux environment (this WSL distro is technically another machine without UI, that just happens to be running locally on your computer), your development tools and experiences are pretty limited. You can run Vim in the terminal to edit your file, or you can edit the sources on the Windows side through the \\wsl$ mount:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The problem with this model is that the Python runtime, pip, or any conda packages for that matter, are not installed on Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Remember, Python is installed in the Linux distro, which means if you’re editing Python files on the Windows side, you can’t run or debug them unless you install the same Python development stack on Windows. And that defeats the purpose of having an isolated Linux instance set up with all your Python tools and runtimes!

Run in WSL

Note: If this command does not work, you may need to restart your terminal, or you may not have added VS Code to your path when it was installed.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The first thing you’ll see is a message about «Installing VS Code Server» (the c7d83e57… number is the version of the VS Code Server that matches the client-side tools you just installed). VS Code is installing a small server on the Linux side that the desktop VS Code will then talk to. That server will then install and host extensions in WSL, so that they run in the context of the tools and frameworks installed in WSL. In other words, your language extensions will run against the tools and frameworks installed in WSL, not against what is installed on the Windows side, as it should for the proper development experience.

The next thing that happens is VS Code will start and open the helloWorld folder. You may see a quick notification telling you that VS Code is connecting to WSL, and you may be prompted to allow access to the Node.js-based server.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Integrated Terminal

Run Terminal > New Terminal ( ⌃` (Windows, Linux Ctrl+` ) ) to open a new terminal instance.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll start a new instance of the bash shell in WSL, again from VS Code running on Windows.

Tip: In the lower left corner of the Status Bar, you can see that you’re connected to your WSL: Ubuntu instance.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Edit and debug

Installing the Python extension (and additional tools)

Click on hello.py to open it for editing. You will be prompted with an extension recommendation, in this case to install the Microsoft Python extension, which will give you rich editing and debugging experiences. Go ahead and select Install and reload if prompted.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To prove that the extension is installed in WSL, open the Extensions view again ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ). You will see a section titled WSL: Ubuntu – Installed, and you can see any extensions that are installed on the WSL side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Upon reload, you’ll also get prompted telling you that the pylint linter is not installed. Linters are used to show errors and warnings in source code. Go ahead and select Install.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Now, when you edit your code, you get rich colorization and completions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

And when you save your file ( ⌘S (Windows, Linux Ctrl+S ) ), you’ll get linting errors and warnings on the file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debugging

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Now, press F5 to run your application. You will be asked how to run the application, and since this is a simple file, just choose Python File.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The app will start, and you’ll hit the breakpoint. You can inspect variables, create watches, and navigate the call stack.

Press F10 to step and you’ll see the output of the print statement in the debug console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You get the full development experience of Visual Studio Code, using the Linux instance installed in WSL.

If you want to open another folder in WSL, open the File menu and choose Open Folder. You’ll get a minimal file and folder navigator for the Linux file system, not the Windows file system.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you want to switch back to the Windows, select the Show Local option and you’ll get the standard Windows File Open dialog.

Ending your WSL connection

You can end your session in WSL and go back to running VS Code locally with File > Close Remote Connection.

Congratulations

Congratulations, you’ve successfully completed this tutorial!

Next, check out the other Remote Development extensions.

Or get them all by installing the Remote Development Extension Pack.

Get started with CMake Tools on Linux

CMake is an open-source, cross-platform tool that uses compiler and platform independent configuration files to generate native build tool files specific to your compiler and platform.

The CMake Tools extension integrates Visual Studio Code and CMake to make it easy to configure, build, and debug your C++ project.

In this tutorial, you’ll use the CMake Tools extension for Visual Studio Code to configure, build, and debug a simple C++ CMake project on Linux. Aside from installing CMake, your compiler, debugger, and build tools, the steps in this tutorial apply generally to how you’d use CMake on other platforms, like Windows.

If you have any trouble, please file an issue for this tutorial in the VS Code documentation repository. Also, for more information about CMake Tools in general, see CMake Tools for Visual Studio Code documentation

Prerequisites

To complete this tutorial on Ubuntu, install the following:

C++ extension for VS Code. Install the C/C++ extension by searching for ‘c++’ in the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

CMake Tools extension for VS Code. Install the CMake Tools extension by searching for ‘CMake tools’ in the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll also need to install CMake, a compiler, a debugger, and build tools.

Ensure that CMake is installed

The VS Code CMake Tools extension does its work by using CMake installed on your system. For best results, use CMake version 3.15 or greater.

See if CMake is already installed on your system. Open a Terminal window and enter the following command:

To install CMake, or to get a later version if you don’t at least have version 3.15, see the instructions for your platform at Kitware APT Repository. Install version 3.15 or greater.

Ensure that development tools are installed

Although you’ll use VS Code to edit your source code, you’ll compile and debug the source code using the compiler, debugger, and build tools (such as make ) installed on your system.

For this tutorial on Ubuntu, we’ll use the GCC compiler, GDB to debug, and make to build the project. These tools are not installed by default on Ubuntu, so you need to install them. Fortunately, that’s easy.

Check if GCC is installed

To see if GCC is already installed on your system, open a Terminal window and enter the following command:

If GCC isn’t installed, run the following command from the Terminal window to update the Ubuntu package lists. An out-of-date Linux distribution can interfere with getting the latest packages.

Create a CMake project

If you have an existing CMake project that already has a CMakeLists.txt file in the root directory, you can skip to Select a kit to configure your existing project.

Create a CMake hello world project

The CMake Tools extension can create the files for a basic CMake project for you. Open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run the CMake: Quick Start command:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Enter a project name. This will be written to CMakeLists.txt and a few initial source files.

Next, select Executable as the project type to create a basic source file ( main.cpp ) that includes a basic main() function.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note: If you had wanted to create a basic source and header file, you would have selected Library instead. But for this tutorial, Executable will do. If you are prompted to configure IntelliSense for the folder, select Allow.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select a kit

Before you can use the CMake Tools extension to build a project, you need to configure it to know about the compilers on your system. Do that by scanning for ‘kits’. A kit represents a toolchain, which is the compiler, linker, and other tools used to build your project. To scan for kits:

Open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run CMake: Select a Kit. The extension will automatically scan for kits on your computer and create a list of compilers found on your system.

Select the compiler you want to use. For example, depending on the compilers you have installed, you might see something like:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Configure Hello World

There are two things you must do to configure your CMake project: select a kit (which you just did) and select a variant.

The kit you selected previously is shown in the Status bar. For example:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To change the kit, you can click on the kit in the Status bar, or run the CMake: Select a kit command again from the Command Palette. If you don’t see the compiler you’re looking for, you can edit the cmake-tools-kits.json file in your project. To edit the file, open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run the CMake: Edit User-Local CMake Kits command.

Select a variant

Debug : disables optimizations and includes debug info. Release : Includes optimizations but no debug info. MinRelSize : Optimizes for size. No debug info. RelWithDebInfo : Optimizes for speed and includes debug info.

To select a variant, open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) run the CMake: Select Variant command.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select Debug to include debug information with your build.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The selected variant will appear in the Status bar next to the active kit.

CMake: Configure

Now that you’ve selected a kit and a variant, open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run the CMake: Configure command to configure your project. This generates build files in the project’s build folder using the kit and variant you selected.

Build hello world

After configuring your project, you’re ready to build. Open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run the CMake: Build command, or select the Build button from the Status bar.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can select which targets you’d like to build by selecting CMake: Set Build Target from the Command Palette. By default, CMake Tools builds all targets. The selected target will appear in the Status bar next to the Build button.

Debug hello world

To run and debug your project, open main.cpp and put a breakpoint on the std::cout line. Then open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run CMake: Debug. The debugger will stop on the std::cout line:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Go ahead and press F5 to continue.

You’ve now used the VS Code CMake Tools extension to use CMake to build and debug a C++ app on Ubuntu. The steps are the same for other platforms; the difference being how you install CMake and the compiler/debugger for the platform of your choice. For instructions on setting up compilers/debuggers for other platforms, see the following:

Terminal Shell Integration

Visual Studio Code has the ability to integrate with common shells, allowing the terminal to understand more about what’s actually happening inside the shell. This additional information enables some useful features such as working directory detection and command detection, decorations and navigation.

Installation

Automatic script injection

Note: On Windows, you’ll need PowerShell 7 (pwsh) for shell integration support. You can install via https://aka.ms/PSWindows.

Manual installation

Tip: When using the Insiders build, replace code with code-insiders below.

bash

Add the following to your

/.bashrc file. Run code

/.bashrc in bash to open the file in VS Code.

pwsh

zsh

Add the following to your

/.zshrc file. Run code

/.zshrc in bash to open the file in VS Code.

Portability versus performance

Features

Command decorations and the overview ruler

One of the things shell integration enables is the ability to get the exit codes of the commands run within the terminal. Using this information, decorations are added to the left of the line to indicate whether the command succeeded or failed. These decorations also show up in the relatively new overview ruler in the scroll bar, just like in the editor.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The decorations can be interacted with to give some contextual actions like re-running the command:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The command decorations can be configured with the following settings:

Command navigation

Run recent command

The Terminal: Run Recent Command command surfaces history from various sources in a Quick Pick, providing similar functionality to a shell’s reverse search ( Ctrl+R ). The sources are the current session’s history, previous session history for this shell type and the common shell history file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Some other functionality of the command:

Go to recent directory

Similar to the run recent command feature, the Terminal: Go to Recent Directory command keeps track of directories that have been visited and allows quick filtering and navigating ( cd ) to them.

Alt can be held to write the text to the terminal without running it.

Current working directory detection

Shell integration tells VS Code what the current working directory of the shell is. This information is not possible to get on Windows without trying to detect the prompt through regex and required polling on macOS and Linux which isn’t good for performance.

One of the biggest features this enables is enhanced resolving of links in the terminal. Take a link package.json for example, when the link is activated while shell integration is disabled this will open a search quick pick with package.json as the filter if there are multiple package.json files in the workspace. When shell integration is enabled however, it will open the package.json file in the current folder directly because the current location is known. This allows the output of ls for example to reliabily open the correct file.

The current working directory is also used to show the directory in the terminal tab, in the run recent command quick pick and for the «terminal.integrated.splitCwd»: «inherited» feature.

Extended PowerShell keybindings

Supported escape sequences

VS Code supports several custom escape sequences:

VS Code’s custom escape sequences are currently designed to only be triggered from within the shell integration script. We may document these in the future which would make it easier for shells to create their own VS Code shell integration scripts.

Final Term shell integration

SetMark ‘OSC 1337 ; SetMark ST’

This sequence adds a mark to the left of the line it was triggered on and also adds an annotation to the scroll bar:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

These marks integrate with command navigation to make them easy to navigate to via ctrl/cmd+up and ctrl/cmd+down by default.

Common questions

When does automatic injection not work?

There are several cases where automatic injection doesn’t work, here are some common cases:

$PROMPT_COMMAND is in an unsupported format, changing it to point to a single function is an easy way to workaround this. For example:

Why are command decorations showing when the feature is disabled?

The likely cause of this is that your system has shell integration for another terminal installed that VS Code understands. If you don’t want any decorations, you can hide them with the following setting:

Alternatively, you could remove the shell integration script from your shell rc/startup script but you will lose access to command-aware features like command navigation.

Command Line Interface (CLI)

Visual Studio Code has a powerful command-line interface built-in that lets you control how you launch the editor. You can open files, install extensions, change the display language, and output diagnostics through command-line options (switches).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you are looking for how to run command-line tools inside VS Code, see the Integrated Terminal.

Command line help

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Launching from command line

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note: Users on macOS must first run a command (Shell Command: Install ‘code’ command in PATH) to add VS Code executable to the PATH environment variable. Read the macOS setup guide for help.

Core CLI options

Here are optional arguments you can use when starting VS Code at the command line via code :

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Opening Files and Folders

Sometimes you will want to open or create a file. If the specified file does not exist, VS Code will create them for you along with any new intermediate folders:

If you specify more than one file at the command line, VS Code will open only a single instance.

If you specify more than one folder at the command line, VS Code will create a Multi-root Workspace including each folder.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Working with extensions

You can install and manage VS Code extensions from the command line.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Advanced CLI options

There are several CLI options that help with reproducing errors and advanced setup.

Opening VS Code with URLs

You can also open projects and files using the platform’s URL handling mechanism. Use the following URL formats to:

Open a file to line and column

You can use the URL in applications such as browsers or file explorers that can parse and redirect the URL. For example, on Windows, you could pass a vscode:// URL directly to the Windows Explorer or to the command line as start vscode:// .

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Next steps

Read on to find out about:

Common questions

‘code’ is not recognized as an internal or external command

Your OS cannot find the VS Code binary code on its path. The VS Code Windows and Linux installations should have installed VS Code on your path. Try uninstalling and reinstalling VS Code. If code is still not found, consult the platform-specific setup topics for Windows and Linux.

On macOS, you need to manually run the Shell Command: Install ‘code’ command in PATH command (available through the Command Palette ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ). Consult the macOS specific setup topic for details.

How do I get access to a command line (terminal) from within VS Code?

VS Code has an Integrated Terminal where you can run command-line tools from within VS Code.

Can I specify the settings location for VS Code in order to have a portable version?

Not directly through the command line, but VS Code has a Portable Mode, which lets you keep settings and data in the same location as your installation, for example, on a USB drive.

Linux installation details

Linux is a highly variable environment and with the sheer number of desktop environments and distributions can be complicated to get working. If you stick to supported versions of Ubuntu Desktop (16.04+), CentOS 7, or Fedora Workstation (27+) and only use official distributions of VS Code, you should find the process straight forward. However, in the event that you are using a non-standard configuration or downstream distribution, you may or may not run into some hiccups. This document provides some information on requirements and some troubleshooting details that might help you get up and running even if your configuration is only community supported. Note that Live Share only supports 64-bit Linux.

Install Linux prerequisites

Some distributions of Linux are missing libraries Live Share needs to function. By default, Live Share attempts to detect and install Linux prerequisites for you. You’ll see a toast notification when Live Share encounters a problem that can originate from missing libraries asking you for permission to install them.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

When you click «Install», a terminal window will appear where your OS will ask you to enter your admin / root (sudo) password to continue. Assuming the script completes successfully, reload Visual Studio Code when prompted you should be all set! You may also want to check out tips by distribution for other hints and workarounds if any exist.

If you see a message indicating the script does not support your distribution, see tips for community supported distributions for information the community has shared with us.

If you prefer not to have VS Code run the command for you, you can also opt to re-run the very latest version of this script at any time manually by using the following command in a Terminal window:

Tips by distribution

While the prerequisite install script above covers a variety of distributions, you may be wondering what is typically missing from vanilla installations. The following list shows the key libraries that were missing in a fresh install of a given distribution. The list also provides some tips that can help you get up and running if you hit a problem.

See tips for community supported distributions for information about other non-Debian / Ubuntu or RHL based distributions.

Additional details can also be found below on the specific libraries Live Share needs.

Tips for community supported distros

PRs welcome: If you’re interested in updating this information with your favorite distribution, submit a PR for this file in our docs GitHub repo. Even better, if you’d like to get the dependency installer supporting your favorite distribution, you can submit a PR for this file.

Install prerequisites manually

While we recommend using Live Share’s dependency install script, this section provides further details on library requirements in the event you want perform these steps yourself or are using a distribution not supported by the script.

Typical missing libraries in vanilla installations can be found in the tips by distribution and tips for community supported distributions sections.

Detailed library requirements

While other distributions require the same libraries, their package names may vary. You can find some of these in the tips for community supported distributions section.

Debian / Ubuntu

For Ubuntu based distributions including Mint, run:

For Debian 9 and non-Ubuntu downstream distributions, run:

Fedora / CentOS / RHL

VS Code OSS Issues

Arch Linux/Manjaro Users: Use the visual-studio-bin AUR package to avoid this problem.

Packages of Visual Studio Code that are either vanilla or modified versions of VS Code OSS can be missing a critical value in product.json file that prevents Visual Studio Live Share from activating.

A quick way to see you might be hitting this problem is to go to Help > «Toggle Developer Tools» and see if you find a stack trace indicating the Live Share extension did not activate because it was using a «proposed API.»

If the extensionAllowedProposedApi property is missing or you do not see «ms-vsliveshare.vsliveshare» referenced, you are using an OSS version with this problem.

As a workaround, you can add the following into the product.json:

See above for additional details on whether the distribution you are using is known to work.

Linux browser integration

Visual Studio Live Share typically does not require additional installation steps to enable browser integration on Linux.

To accomplish this, Live Share automatically places a desktop file in

/.local/share/applications and the required launcher itself in

/.local/share/vsliveshare when the extension first initializes. No action is required on your part if this succeeds.

In some cases, distributions either do not support this location or require tweaks to get it to work with their vanilla installs. In these cases, Live Share falls back to using /usr/local/share instead. As a result, you may be notified that your admin (sudo) password is required to complete the installation process. A terminal window will appear telling you where the browser launcher will be installed. Simply enter your password when prompted and press enter once the installation completes to close the terminal window.

If you’d prefer to run the command yourself instead, you can click «Copy instead» which will copy the terminal command to the clipboard instead.

Finally, if you opt to skip this step entirely, you can still join collaboration sessions manually, but you will not be able to join by opening an invite link in the browser. Note that you can always access the command again later, by hitting Ctrl+Shift+P / Cmd+Shift+P and selecting the «Live Share: Launcher Setup» command.

Загрузка, установка и настройка рабочей нагрузки Linux

Проекты Linux поддерживаются в Visual Studio версии 2017 и выше. Чтобы увидеть документацию для этих версий, установите в данной статье селектор Версия Visual Studio в Visual Studio 2017 или Visual Studio 2019. Он находится в верхней части оглавления на этой странице.

Вы можете использовать интегрированную среду разработки Visual Studio в Windows для создания, редактирования и отладки проектов C++, которые выполняются в удаленной системе Linux, на виртуальной машине или в подсистеме Windows для Linux.

Вы можете работать с имеющейся базой кода, где CMake не требуется преобразовывать в проект Visual Studio. Если база кода является кроссплатформенной, в Visual Studio можно создавать решения как для Windows, так и для Linux. Например, с помощью Visual Studio можно редактировать, выполнять сборку и отлаживать свой код в Windows. Затем можно быстро перенацелить проект для Linux на сборку и отладку в среде Linux. Файлы заголовков Linux автоматически копируются на ваш локальный компьютер. Visual Studio использует их для обеспечения полной поддержки технологии IntelliSense (завершение операторов, переход к определению и т. д.).

Установка Visual Studio

В поле поиска Windows введите «Visual Studio Installer»:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Если вы используете внедренную платформу или платформу Интернета вещей, перейдите в панель Сведения об установке, которая находится справа. В разделе Разработка для Linux на C ++ разверните узел Необязательные компоненты и выберите нужные компоненты. Поддержка CMake для Linux включена по умолчанию.

Для продолжения установки нажмите кнопку Изменить.

Варианты создания среды Linux

Если у вас нет компьютера Linux, можно создать виртуальную машину Linux в Azure. Дополнительные сведения см. в разделе Краткое руководство. Создание виртуальной машины Linux на портале Azure.

В Windows 10 и более поздних версий можно установить и настроить использование определенного дистрибутива Linux в подсистеме Windows для Linux (WSL). См. подробнее руководство по установке подсистемы Windows для Linux в Windows 10. Если не удается получить доступ к Microsoft Store, можете вручную скачать пакеты дистрибутивов WSL. WSL — это удобная консольная среда, но ее не рекомендуется использовать для графических приложений.

Для проектов Linux в Visual Studio необходимо установить следующие зависимости в удаленной системе Linux или WSL:

В следующих командах предполагается, что вы используете g++ вместо clang.

Для проектов Linux в Visual Studio необходимо установить следующие зависимости в удаленной системе Linux или WSL:

Установка Linux: Использование Ubuntu в WSL

Если вы используете WSL, для сборки и отладки не требуется добавлять удаленное подключение или настраивать SSH. Использование zip и rsync является обязательным для автоматической синхронизации заголовков Linux в Visual Studio и включения поддержки Intellisense. ninja-build требуется только для проектов CMake. Если необходимые приложения отсутствуют, их можно установить с помощью следующей команды:

Использование Ubuntu в удаленных системах Linux

В командной строке оболочки на компьютере Linux выполните следующую команду:

Для выполнения команды sudo вам может быть предложено ввести пароль учетной записи root. Введите его и продолжите. После завершения будут установлены требуемые службы и средства.

Запустите службу ssh на компьютере Linux, выполнив следующую команду:

Эта команда запускает службу в фоновом режиме и в состоянии готовности к принятию подключений.

Использование Fedora в WSL

Использование zip и rsync является обязательным для автоматической синхронизации заголовков Linux в Visual Studio и включения поддержки Intellisense. ninja-build требуется только для проектов CMake.

Использование Fedora в удаленных системах Linux

В командной строке оболочки на компьютере Linux выполните следующую команду:

Для выполнения команды sudo вам может быть предложено ввести пароль учетной записи root. Введите его и продолжите. После завершения будут установлены требуемые службы и средства.

Запустите службу ssh на компьютере Linux, выполнив следующую команду:

Эта команда запускает службу в фоновом режиме и в состоянии готовности к принятию подключений.

Следующие шаги

Теперь вы можете создать или открыть проект Linux, а также настроить его для выполнения в целевой системе. Дополнительные сведения можно найти в разделе

Developing in WSL

The extension runs commands and other extensions directly in WSL so you can edit files located in WSL or the mounted Windows filesystem (for example /mnt/c ) without worrying about pathing issues, binary compatibility, or other cross-OS challenges.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

This lets VS Code provide a local-quality development experience — including full IntelliSense (completions), code navigation, and debugging — regardless of where your code is hosted.

Getting started

Note: After reviewing this topic, you can get started with the introductory WSL tutorial.

Installation

To get started, you need to:

Install the Windows Subsystem for Linux along with your preferred Linux distribution.

Note: WSL 1 does have some known limitations for certain types of development. Also, extensions installed in Alpine Linux may not work due to glibc dependencies in native source code inside the extension. See the Remote Development and Linux article for details.

Install Visual Studio Code on the Windows side (not in WSL).

Note: When prompted to Select Additional Tasks during installation, be sure to check the Add to PATH option so you can easily open a folder in WSL using the code command.

Open a remote folder or workspace

From the WSL terminal

Opening a folder inside the Windows Subsystem for Linux in VS Code is very similar to opening up a Windows folder from the command prompt or PowerShell.

Open a WSL terminal window (using the start menu item or by typing wsl from a command prompt / PowerShell).

Navigate to a folder you’d like to open in VS Code (including, but not limited to, Windows filesystem mounts like /mnt/c )

Note: If this command does not work, you may need to restart your terminal or you may not have added VS Code to your path when it was installed.

After a moment, a new VS Code window will appear, and you’ll see a notification that VS Code is opening the folder in WSL.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

VS Code will now continue to configure itself in WSL and keep you up to date as it makes progress.

Once finished, you now see a WSL indicator in the bottom left corner, and you’ll be able to use VS Code as you would normally!

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

That’s it! Any VS Code operations you perform in this window will be executed in the WSL environment, everything from editing and file operations, to debugging, using terminals, and more.

From VS Code

Alternatively, you can open a Remote WSL window directly from VS Code:

If you already have a folder open, you can also use the Remote-WSL: Reopen in WSL command. You will be prompted which distro to use.

If you are in a WSL window and want to open the current input in a local window, use Remote-WSL: Reopen in Windows.

From the Windows command prompt

We need to do some guessing on whether the input path is a file or a folder. If it has a file extension, it is considered a file.

To force that a folder is opened, add slash to the path or use:

Working with Git

If you are working with the same repository in WSL and Windows, be sure to set up consistent line endings. See tips and tricks for details.

You can also avoid passwords by configuring WSL to use the Windows Git credential manager. See tips and tricks for details.

Managing extensions

VS Code runs extensions in one of two places: locally on the UI / client side, or in WSL. While extensions that affect the VS Code UI, like themes and snippets, are installed locally, most extensions will reside inside WSL.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note: If you are an extension author and your extension is not working properly or installs in the wrong place, see Supporting Remote Development for details.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Opening a terminal in WSL

Opening a terminal in WSL from VS Code is simple. Once folder is opened in WSL, any terminal window you open in VS Code (Terminal > New Terminal) will automatically run in WSL rather than locally.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debugging in WSL

Once you’ve opened a folder in WSL, you can use VS Code’s debugger in the same way you would when running the application locally. For example, if you select a launch configuration in launch.json and start debugging ( F5 ), the application will start on remote host and attach the debugger to it.

WSL specific settings

VS Code’s local user settings are also reused when you have opened a folder in WSL. While this keeps your user experience consistent, you may want to vary some of these settings between your local machine and WSL. Fortunately, once you have connected to WSL, you can also set WSL specific settings by running the Preferences: Open Remote Settings command from the Command Palette ( F1 ) or by selecting the Remote tab in the Settings editor. These will override any local settings you have in place whenever you open a folder in WSL.

Advanced: Environment setup script

When VS Code Remote is started in WSL, no shell startup scripts are run. This was done to avoid issues with startup scripts that are tuned for shells. If you want to run additional commands or modify the environment this can be done in a setup script

/.vscode-server-insiders/server-env-setup ). If present, the script is processed before the server is started.

The script needs to be a valid Bourne shell script. Be aware that an invalid script will prevent the server from starting up. If you end up with a script that prevents the server from starting, you will have to use a regular WSL shell and delete or rename the setup script.

Check the WSL log (Remote WSL: Open WSL Log) for output and errors.

Advanced: Opening a WSL 2 folder in a container

If you have not already, install and setup Docker Desktop’s WSL 2 support.

Tip: Go to Settings > Resources > WSL Integration and enable Docker integration with the WSL distribution you will be using.

Once your folder is open in WSL, select Remote-Containers: Reopen Folder in Container from the Command Palette ( F1 ).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The VS Code window (instance) will reload and start building the dev container. A progress notification provides status updates.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After the build completes, VS Code will automatically connect to the container. You can now work with the your source code from inside the container.

Known limitations

This section contains a list of common know issues with WSL. The intent is not to provide a complete list of issues but to highlight some of the common problems seen with WSL.

I see EACCESS: permission denied error trying to rename a folder in the open workspace in WSL 1

That’s a known problem with the WSL file system implementation (Microsoft/WSL#3395, Microsoft/WSL#1956) caused by the file watcher active by VSCode. The issue will only be fixed in WSL 2.

To avoid the issue, set remote.WSL.fileWatcher.polling to true. However, polling based file watching has a performance impact for large workspaces.

WSL 2 does not have that file watcher problem is also not affected by the new setting.

Golang in WSL 1

IssueExisting issues
Delve debugger doesn’t work under WSLgo-delve/delve#810, Microsoft/vscode-go#926

Node.js in WSL 1

IssueExisting issues
NodeJS Error: spawn EACCES (different variants of this error)Microsoft/WSL#3886
Webpack HMR not workingMicrosoft/WSL#2709
Firebase via node unusably slow only on WSLMicrosoft/WSL#2657

Git limitations

If you clone a Git repository using SSH and your SSH key has a passphrase, VS Code’s pull and sync features may hang when running remotely. Either use an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to work around the issue.

Docker Extension limitations

While the Docker extension can run both remotely and locally, if it is already installed locally, you will be unable to install on a remote SSH host without first uninstalling it locally. We will address this problem in a future VS Code release.

Extension limitations

Many extensions will work in WSL without modification. However, in some cases, certain features may require changes. If you run into an extension issue, see here for a summary of common problems and solutions that you can mention to the extension author when reporting the issue.

In addition, some extensions installed in an WSL when using an Alpine Linux-based distribution may not work due to glibc dependencies in native code inside the extension. See the Remote Development with Linux article for details.

Common questions

Why am I asked to change the default distro?

You can always manually switch the default distro by using wslconfig.exe.

You can see which distributions you have installed using:

I’m seeing an error about a missing library or dependency

Some extensions rely on libraries not found in the vanilla install of certain WSL Linux distributions. You can add additional libraries into your Linux distribution by using its package manager. For Ubuntu and Debian based distributions, run sudo apt-get install

to install the needed libraries. Check the documentation for your extension or the runtime that is mentioned for additional installation details.

All other communication between the server and the VS Code client is accomplished through an random local TCP port. You can find a list of locations VS Code itself needs access to in the network connections article.

I’m behind a proxy and have connectivity issues

Proxy settings might be missing on either the Windows or the WSL side.

When the remote VSCode is started from a WSL terminal, the download is done using wget in the WSL distro. Proxy settings can be configured in:

Once the server is up and running the proxy settings on the Remote tab are used.

Extensions are typically designed and tested to either run locally or remotely, not both. However, if an extension supports it, you can force it to run in a particular location in your settings.json file.

For example, the setting below will force the Docker extension to run locally and Debugger for Chrome extension to run remotely instead of their defaults:

A value of «ui» instead of «workspace» will force the extension to run on the local UI/client side instead. Typically, this should only be used for testing unless otherwise noted in the extension’s documentation since it can break extensions. See the article on Supporting Remote Development for details.

As an extension author, what do I need to do?

The VS Code extension API abstracts away local/remote details so most extensions will work without modification. However, given extensions can use any node module or runtime they want, there are situations where adjustments may need to be made. We recommend you test your extension to be sure that no updates are required. See Supporting Remote Development for details.

Download, install, and set up the Linux workload

Linux projects are supported in Visual Studio 2017 and later. To see the documentation for these versions, set the Visual Studio Version selector control for this article to Visual Studio 2017 or Visual Studio 2019. It’s found at the top of the table of contents on this page.

You can use the Visual Studio IDE on Windows to create, edit, and debug C++ projects that execute on a remote Linux system, virtual machine, or the Windows Subsystem for Linux.

You can work on your existing code base that uses CMake without having to convert it to a Visual Studio project. If your code base is cross-platform, you can target both Windows and Linux from within Visual Studio. For example, you can edit, build, and debug your code on Windows using Visual Studio. Then, quickly retarget the project for Linux to build and debug in a Linux environment. Linux header files are automatically copied to your local machine. Visual Studio uses them to provide full IntelliSense support (Statement Completion, Go to Definition, and so on).

For any of these scenarios, the Linux development with C++ workload is required.

Visual Studio setup

Type «Visual Studio Installer» in the Windows search box:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Look for the installer under the Apps results and double-click it. When the installer opens, choose Modify, and then click on the Workloads tab. Scroll down to Other toolsets and select the Linux development with C++ workload.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you’re targeting IoT or embedded platforms, go to the Installation details pane on the right. Under Linux development with C++, expand Optional Components, and choose the components you need. CMake support for Linux is selected by default.

Click Modify to continue with the installation.

Options for creating a Linux environment

If you don’t already have a Linux machine, you can create a Linux Virtual Machine on Azure. For more information, see Quickstart: Create a Linux virtual machine in the Azure portal.

On Windows 10 and later, you can install and target your favorite Linux distro on the Windows Subsystem for Linux (WSL). For more information, see Windows Subsystem for Linux Installation Guide for Windows 10. If you’re unable to access the Windows Store, you can manually download the WSL distro packages. WSL is a convenient console environment, but it’s not recommended for graphical applications.

Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:

The following commands assume you’re using g++ instead of clang.

Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:

Linux setup: Ubuntu on WSL

When you’re targeting WSL, there’s no need to add a remote connection or configure SSH to build and debug. zip and rsync are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. ninja-build is only required for CMake projects. If the required applications aren’t already present, you can install them using this command:

Ubuntu on remote Linux systems

The target Linux system must have openssh-server, g++, gdb, and make installed. ninja-build is required for CMake projects only. The ssh daemon must be running. zip and rsync are required for automatic syncing of remote headers with your local machine for Intellisense support. If these applications aren’t already present, you can install them as follows:

At a shell prompt on your Linux computer, run:

You may be prompted for your root password to run the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.

Ensure the ssh service is running on your Linux computer by running:

This command starts the service and runs it in the background, ready to accept connections.

Fedora on WSL

Fedora uses the dnf package installer. To download g++, gdb, make, rsync, ninja-build, and zip, run:

zip and rsync are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. ninja-build is only required for CMake projects.

Fedora on remote Linux systems

The target machine running Fedora uses the dnf package installer. To download openssh-server, g++, gdb, make, ninja-build, rsync, and zip, and restart the ssh daemon, follow these instructions. ninja-build is only required for CMake projects.

At a shell prompt on your Linux computer, run:

You may be prompted for your root password to run the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.

Ensure the ssh service is running on your Linux computer by running:

This command starts the service and runs it in the background, ready to accept connections.

Next Steps

You’re now ready to create or open a Linux project and configure it to run on the target system. For more information, see:

Установка Visual Studio Code в Linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Каждому программисту нужно иметь удобное приложение, в котором он будет набирать и редактировать исходный код. Visual Studio Code — одно из лучших решений, распространяемое как на Windows, так и на операционные системы на ядре Linux. Инсталляция упомянутого редактора может производиться разными методами, каждый из которых будет наиболее оптимальным для определенного класса пользователей. Давайте сегодня остановимся на этой процедуре и разберемся со всеми действиями максимально подробно.

К сожалению, интегрированная среда разработки под названием Visual Studio доступна только для ПК под управлением ОС Windows. Следует сразу обратить внимание, что в этой статье мы показываем, как загрузить редактор исходного кода Visual Studio Code — одно из решений в линейке VS.

Устанавливаем Visual Studio Code в Linux

Конечно, дистрибутивов, написанных на ядре Linux, достаточно много. Однако сейчас особой популярностью пользуются ОС, за основу которых взят Debian либо Ubuntu. Именно на такие платформы мы и хотим обратить внимание, взяв для наглядности Ubuntu 18.04. Обладателям других дистрибутивов мы тоже подскажем, каким образом лучше всего будет произвести установку, однако давайте начнем по порядку.

Способ 1: Использование репозиториев через консоль

Компания Microsoft активно следит за своими официальными хранилищами. Последние версии программ туда оперативно выкладываются и пользователи сразу же могут скачать их и без каких-либо проблем инсталлировать на свой компьютер. Что же касается Visual Studio Code, здесь следует рассмотреть варианты с использованием двух разных репозиториев. Взаимодействие с первым выглядит следующим образом:

Однако не каждому пользователю подходит метод инсталляции через представленный репозиторий, поэтому советуем ознакомиться с альтернативным вариантом, который не сложнее рассмотренного.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Способ 2: Скачивание официального DEB-пакета

Не всем юзерам порой удобно работать через консоль или могут возникнуть какие-то трудности с командами. К тому же иногда на компьютере отсутствует подключение к интернету. В этих случаях на помощь приходит официальный DEB-пакет, который вы можете предварительно загрузить на носитель и уже на своем ПК установить VS Code.

Если же появилась надобность в добавлении обновлений к рассматриваемому софту, откройте консоль и поочередно вводите следующие команды:

sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code

Что касается пользователей, использующих дистрибутивы, разработанные на основе RHEL, Fedora или CentOS, вам следует использовать указанные ниже строки, чтобы провести инсталляцию программы.

Существуют обладатели и ОС на openSUSE and SLE. Здесь код немного меняется:

Обновление же производится через последовательную активацию sudo zypper refresh и sudo zypper install code

Теперь вы ознакомлены с методами установки Visual Studio Code на разные дистрибутивы ядра Linux. Если же вы столкнулись с какими-либо проблемами или неполадками, обязательно сначала ознакомьтесь с текстом ошибки, изучите официальную документацию операционной системы, а также оставляйте вопросы в комментариях.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Как пользоваться Visual Studio Code

Как пользоваться Visual Studio Code

В отличие от предыдущих статей на эту тему, я не буду рассказывать про установку. Об этом есть полноценная статья, поэтому посмотрите там. Программа без труда ставится с официального сайта или из snap-пакета в любом дистрибутиве, основанном на Debian или RedHat. Первым делом остановимся на интерфейсе программы. Причём будет рассмотрена именно работа Visual Studio Code для начинающих. Если вы уже опытный разработчик, вряд-ли вы найдёте для себя что-то новое.

1. Интерфейс Visual Studio Code

Интерфейс программы типичен для многих редакторов кода. Но есть и свои особенности. Условно главное окно программы можно разделить на семь частей:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Именно этими участками вы будете пользоваться во время работы с VS Code:

2. Русификация Visual Studio Code

По умолчанию среда устанавливается на английском языке. Лучше так всё и оставить: большинство информации по программированию в интернете на английском языке, и, если вы привыкните к такому формату, вам будет проще во всём этом ориентироваться. Но если вас интересует, как русифицировать Visual Studio Code, то делается это очень просто. На боковой панели кликните по значку с квадратиками, который отвечает за установку дополнений, и наберите в поле поиска vscode-language-pack-ru; утилита найдёт только один пакет, нажмите Install, чтобы установить его:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Для выбора языка нажмите Ctrl+Shift+P и начните набирать Config, в предложенном списке выберите Configure Display Language:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Затем выберите ru и перезапустите программу. Всё. После этого интерфейс программы станет русским.

3. Внешний вид

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Затем в открывшемся меню осталось выбрать нужную тему стрелками и нажать Enter. По умолчанию доступно несколько тёмных и светлых тем:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Скачать новые темы можно с официального сайта Visual Studio Code. Здесь же можно настроить тему иконок.

4. Управление проектами

Очень часто бывает, что приходится переключаться между несколькими проектами во время работы. По умолчанию в VS Code для этого надо открывать рабочую папку проекта через меню. Но есть выход. Это расширение Project Manager. С его помощью вы можете сохранять проекты и переключаться между ними в один клик. Установите Project Manager как было описано выше, затем кликните на боковой панели по значку с папкой.

Здесь отображается список доступных проектов. Чтобы запомнить текущую папку в качестве проекта, кликните по значку с дискетой и введите имя проекта:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

После этого вы сможете очень просто управлять своими проектами.

5. Авто-форматирование кода

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

6. Автодополнение

Очень сильно помогает в разработке автоматическое дополнение кода. Вы пишите начало слова, а среда сама вам подсказывает, чем его можно завершить. Пакеты, которые позволяют выполнять автодополнение, называются *-intellisense. Рекомендуется установить PHP Intellisense, CSS Intellisense и Path Intellisense для автодополнения путей к файлам. Для разных фреймворков существуют свои расширения автоматического дополнения кода, например, для Laravel есть Laravel Extra Intellisense. Подсветка синтаксиса обычно уже встроена в VS Code для многих языков, однако если её нет, тоже ищите расширение.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

7. Управление Vim

8. Отладка кода

В Visual Code есть интерфейс, с помощью которого выполняется отладка кода, но прежде, чем вы его сможете использовать для PHP, его придётся настроить. Для отладки кода на PHP используется отладчик Xdebug, поэтому необходимо установить дополнение PHP Debug. Далее кликните по треугольнику со значком жука на боковой панели. Если вы раньше ничего не отлаживали в этом проекте, то программа предложит вам создать файл launch.json. Кликните по этой ссылке. В открывшемся списке выберите PHP:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

В полученном файле надо обратить внимание только на поле port. Он должен быть такой же, как и значение переменной xdebug.remote_port в php.ini. У меня это 9008. Сохраните изменения и нажмите зелёный треугольник для начала отладки.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Возможно, программа ещё спросит путь к папке с файлами проекта. Если это локальный компьютер, то проблем возникнуть не должно. Затем нужно выбрать точки остановки. Эти точки ставятся в самой левой части области редактора напротив строчки, в которой вы хотите остановится:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Последний шаг: надо открыть отлаживаемую страницу в браузере, но при этом для Chrome надо использовать расширение Xdebug Helper, которое включает необходимый флаг и сообщает Xdebug, что этот код надо отлаживать. Для этого надо выбрать режим Debug в расширении:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Затем Xdebug подключается к VS Code по выбранному нами порту и передаёт туда всю необходимую информацию. Только после этого вы сможете смотреть переменные и выполнять код пошагово:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

9. Терминал

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

10. Использование Git

Кроме того, вы можете делать фиксацию изменений (коммиты) и отправлять изменения на сервер прямо в графическом интерфейсе. Сначала надо добавить файлы в коммит: кликните по значку разветвления на боковой панели. Здесь отображаются все изменённые файлы. Нажмите + напротив файлов, которые надо добавить:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Для того чтобы зафиксировать изменения, наберите пояснение к комиту в текстовой строке, затем нажмите Ctrl+Enter или галочку над текстовым полем:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Теперь осталось отправить изменения в репозиторий, для этого используйте кнопку в статус-баре со значком обновления. Смотрите на предыдущем снимке.

Выводы

В этой статье мы рассмотрели, как работать в Visual Studio Code для программирования на PHP и других языках программирования, предназначенных для веб-разработки. Как видите, эта среда намного лучше подготовлена по умолчанию, чем тот же Atom и то, что приходится настраивать там, здесь уже есть «из коробки». А какой средой разработки пользуетесь вы? Напишите в комментариях!

Как установить код Visual Studio на Ubuntu 20.04

Visual Studio Code является кроссплатформенным, доступен в Windows, Linux и macOS.

В этом руководстве показаны два способа установки Visual Studio Code на Ubuntu 20.04. VS Code можно установить как snap-пакет через магазин Snapcraft или как deb-пакет из репозиториев Microsoft.

Выберите метод установки, наиболее подходящий для вашей среды.

Установка кода Visual Studio в виде Snap-пакета

Пакет оснастки Visual Studio Code распространяется и поддерживается Microsoft.

Снапсы — это автономные программные пакеты, которые включают в двоичный файл все зависимости, необходимые для запуска приложения. Пакеты Snap легко обновить и защитить. В отличие от стандартных пакетов deb, снимки занимают больше места на диске и дольше запускают приложение.

Пакеты Snap могут быть установлены либо из командной строки, либо через приложение Ubuntu Software.

Чтобы установить привязку VS Code, откройте свой терминал ( Ctrl+Alt+T ) и выполните следующую команду:

Вот и все. Visual Studio Code установлен на вашем компьютере с Ubuntu.

Если вы предпочитаете использовать графический интерфейс, откройте программное обеспечение Ubuntu, найдите «Код Visual Studio» и установите приложение:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Каждый раз при выпуске новой версии пакет Visual Studio Code будет автоматически обновляться в фоновом режиме.

Установка кода Visual Studio с помощью apt

Код Visual Studio доступен в официальных репозиториях Microsoft Apt. Чтобы установить его, выполните следующие действия:

Обновите индекс пакетов и установите зависимости, выполнив следующую команду от имени пользователя с привилегиями sudo :

Импортируйте ключ Microsoft GPG с помощью следующей команды wget :

И включите репозиторий Visual Studio Code, набрав:

После включения репозитория apt установите пакет Visual Studio Code:

Когда будет выпущена новая версия, вы можете обновить пакет Visual Studio Code с помощью стандартного инструмента обновления программного обеспечения на рабочем столе или выполнив следующие команды в своем терминале:

Запуск кода Visual Studio

В строке поиска действий введите «Код Visual Studio» и щелкните значок, чтобы запустить приложение.

Когда вы запускаете VS Code в первый раз, должно появиться следующее окно:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Теперь вы можете приступить к установке расширений и настройке VS Code в соответствии с вашими предпочтениями.

Выводы

Мы объяснили, как установить VS Code в Ubuntu 20.04.

Если у вас есть вопросы, оставьте комментарий ниже.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Use the Windows Subsystem for Linux (WSL)

What is WSL?

The Windows Subsystem for Linux (WSL) lets you run a Linux environment, including command-line tools and applications, directly on Windows, without the overhead of a traditional virtual machine or dual boot setup.

WSL especially helps web developers and those working with Bash and Linux-first tools (for example, Ruby and Python) to use their tools on Windows and ensure consistency between development and production environments.

Get started with WSL in VS Code

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll also need WSL and a Linux distribution installed. We recommend using WSL 2, which is the newest version of WSL, as you will benefit from significant performance advantages over WSL 1.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Next steps

We highly recommend checking out the step-by-step WSL tutorial to learn more.

Download, install, and set up the Linux workload

Linux projects are supported in Visual Studio 2017 and later. To see the documentation for these versions, set the Visual Studio Version selector control for this article to Visual Studio 2017 or Visual Studio 2019. It’s found at the top of the table of contents on this page.

You can use the Visual Studio IDE on Windows to create, edit, and debug C++ projects that execute on a remote Linux system, virtual machine, or the Windows Subsystem for Linux.

You can work on your existing code base that uses CMake without having to convert it to a Visual Studio project. If your code base is cross-platform, you can target both Windows and Linux from within Visual Studio. For example, you can edit, build, and debug your code on Windows using Visual Studio. Then, quickly retarget the project for Linux to build and debug in a Linux environment. Linux header files are automatically copied to your local machine. Visual Studio uses them to provide full IntelliSense support (Statement Completion, Go to Definition, and so on).

For any of these scenarios, the Linux development with C++ workload is required.

Visual Studio setup

Type «Visual Studio Installer» in the Windows search box:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Look for the installer under the Apps results and double-click it. When the installer opens, choose Modify, and then click on the Workloads tab. Scroll down to Other toolsets and select the Linux development with C++ workload.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you’re targeting IoT or embedded platforms, go to the Installation details pane on the right. Under Linux development with C++, expand Optional Components, and choose the components you need. CMake support for Linux is selected by default.

Click Modify to continue with the installation.

Options for creating a Linux environment

If you don’t already have a Linux machine, you can create a Linux Virtual Machine on Azure. For more information, see Quickstart: Create a Linux virtual machine in the Azure portal.

On Windows 10 and later, you can install and target your favorite Linux distro on the Windows Subsystem for Linux (WSL). For more information, see Windows Subsystem for Linux Installation Guide for Windows 10. If you’re unable to access the Windows Store, you can manually download the WSL distro packages. WSL is a convenient console environment, but it’s not recommended for graphical applications.

Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:

The following commands assume you’re using g++ instead of clang.

Linux projects in Visual Studio require the following dependencies to be installed on your remote Linux system or WSL:

Linux setup: Ubuntu on WSL

When you’re targeting WSL, there’s no need to add a remote connection or configure SSH to build and debug. zip and rsync are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. ninja-build is only required for CMake projects. If the required applications aren’t already present, you can install them using this command:

Ubuntu on remote Linux systems

The target Linux system must have openssh-server, g++, gdb, and make installed. ninja-build is required for CMake projects only. The ssh daemon must be running. zip and rsync are required for automatic syncing of remote headers with your local machine for Intellisense support. If these applications aren’t already present, you can install them as follows:

At a shell prompt on your Linux computer, run:

You may be prompted for your root password to run the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.

Ensure the ssh service is running on your Linux computer by running:

This command starts the service and runs it in the background, ready to accept connections.

Fedora on WSL

Fedora uses the dnf package installer. To download g++, gdb, make, rsync, ninja-build, and zip, run:

zip and rsync are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. ninja-build is only required for CMake projects.

Fedora on remote Linux systems

The target machine running Fedora uses the dnf package installer. To download openssh-server, g++, gdb, make, ninja-build, rsync, and zip, and restart the ssh daemon, follow these instructions. ninja-build is only required for CMake projects.

At a shell prompt on your Linux computer, run:

You may be prompted for your root password to run the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.

Ensure the ssh service is running on your Linux computer by running:

This command starts the service and runs it in the background, ready to accept connections.

Next Steps

You’re now ready to create or open a Linux project and configure it to run on the target system. For more information, see:

How do I install Visual Studio Code?

I just downloaded VSCode-linux-x64 from the Microsoft website. It’s a 62 MB zip file. How can I install it on my Ubuntu system?

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

12 Answers 12

Update

VSCode is now available as DEB file. You can download it and then run:

In case dpkg complains about missing dependencies, run:

afterwards to fix the problem.

Old answer

Visual Studio Code enabled official Linux repositories on February 2017 (v1.10)

You can upgrade / dist-upgrade as usual

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Works fine on Xenial. Maybe someone creates a PPA to simplify updates. Or it ‘ll become part of the official repository.

Update 03/17: Since version 1.10 (February 2017) there is built-in support for official Linux repositories. VS Code now can auto-update on Linux, although you have to install it one time manually.

Install the snap.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The way I’ve done it is as follows. Using a terminal:

Create a directory for the files and change to this directory:

The directory name is arbitrary.

Unpack the zip file in your new folder:

Run the ide using

You can also create a desktop link so that you can start it directly from the desktop or double-click in nautilus.

To create a menu entry:

At the terminal, create a file

and copy and paste the following:

I also downloaded an MS icon for this application from

and moved it to /opt/msvs :

Visual Studio Code doesn’t have to be installed, per se. Instead you can unzip the archive wherever you want it, then run the program by double-clicking the file called code (which is the main executable).

Here’s a GUI-oriented procedure for doing so:

Go to the Visual Studio Code site and click Download Code for Linux. (You should probably also review the license terms and privacy policy.)

Make a new folder where you want Visual Studio Code to go. It’s best to do this within your home folder (if other users want to use Visual Studio Code, it could be extracted separated for them—then any modifications or configuration changes will be per-user).

To run Visual Studio Code, double-click on the code executable, which is one of the files that was extracted.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Linux-разработка в Windows с WSL и Visual Studio Code Remote

Работа с VS Code Remote и Windows Subsystem for Linux (WSL) дает возможность использовать полнофункциональную среду разработки Linux на ноутбуке или десктопе с предустановленной Windows. В этом материале рассмотрим то, как использовать эти инструменты для разработки приложений на Python в Linux.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Первым делом: установка необходимых компонентов

Чтобы выполнить все действия описанные в данной статье, вам понадобятся WSL и VS Code с установленным расширением VS Code Remote — WSL. Давайте быстро рассмотрим, что это такое и как это установить.

Windows Subsystem for Linux

Инструмент Windows Subsystem for Linux, сокращённо WSL, позволяет запускать неизмененные двоичные файлы Linux непосредственно в Windows. Это означает, что вы можете использовать ваши любимые инструменты Linux, приложения командной строки и рабочие процессы на вашем компьютере с Windows, без необходимости использовать сложные настройки, такие как Dual Boot. А лучше всего то, что WSL является тесно интегрированным решением между Windows и Linux. Иначе говоря, если вы любите Linux, то вы можете получить доступ ко всем файлам и исполняемым файлам Windows прямо из оболочки bash, а если вы любите Windows, то вы можете легко получить доступ к двоичным файлам и файлам Linux из PowerShell или CMD.

Если вы новичок в WSL и хотите узнать больше, то можете пройти наш полный курс: Начало работы с подсистемой Windows для Linux, либо ознакомиться только с инструкцией по установке в документации WSL.

Visual Studio Code

Вам также потребуется расширение VS Code Remote — WSL, которое позволяет использовать контейнер, удаленный компьютер или Windows Subsystem for Linux (WSL) в качестве полнофункциональной среды разработки. Чтобы узнать больше и начать работу, посетите страницу с документацией по VS Code Remote.

На старт, внимание, Linux!

Вместо написания длинного раздела по началу работы с VS Code Remote в WSL, мы решили снять это небольшое видео, демонстрирующее ведение разработки на Python в WSL, с использованием VS Code Remote.

Это не просто изолированный Python, вы можете использовать VSCode Remote и WSL в любом Linux-проекте

При использовании VS Code Remote в WSL команды и расширения запускаются непосредственно в дистрибутиве Linux, поэтому вам не нужно беспокоиться о проблемах двоичной совместимости или других проблемах, связанных с кросс-ОС. Вы можете использовать VS Code в WSL так же, как и в Windows.

VS Code Remote и WSL меняют правила игры, когда дело доходит до разработки под Linux на Windows. Эти инструменты позволяют разрабатывать, запускать и отлаживать тонны приложений Linux непосредственно на вашем компьютере с Windows, предоставляя вам лучшее из среды Windows и Linux.

Если вы желаете узнать больше о Windows Subsystem for Linux и все о командной строке Windows, то следите за обновлениями в этом блоге! А если вам интересно узнать больше о VS Code Remote, вы можете прочитать статью в блоге здесь и обширную документацию, охватывающую архитектуру, здесь.

Мы рады представить вам мощную комбинацию из VS Code Remote и WSL!

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Terminal Basics

Visual Studio Code includes a fully-featured integrated terminal that conveniently starts at the root of your workspace. It provides integration with the editor to support features like links and error detection.

To open the terminal:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note: Open an external terminal with the ⇧⌘C (Windows, Linux Ctrl+Shift+C ) keyboard shortcut if you prefer to work outside VS Code.

Terminal shells

The integrated terminal can use various shells installed on your machine, with the defaults being:

You can select other available shells to use in terminal instances or as the default such as Command Prompt on Windows, and zsh on macOS and Linux.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can learn more about configuring terminal shells in the terminal profiles section below.

Note: If you’re having trouble launching your preferred shell in the integrated terminal, it may be due to your shell’s configuration or a VS Code terminal setting. There’s a dedicated troubleshooting guide to help you with these sorts of problems.

Managing terminals

The terminal tabs UI is on the right side of the terminal view. Each terminal has an entry with its name, icon, color, and group decoration (if any).

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Tip: Change the tabs location using the terminal.integrated.tabs.location setting.

Terminal instances can be added by selecting the + icon on the top-right of the TERMINAL panel, selecting a profile from the terminal dropdown, or by triggering the ⌃⇧` (Windows, Linux Ctrl+Shift+` ) command. This action creates another entry in the tab list associated with that terminal.

Icons may appear to the right of the terminal title on the tab label when a terminal’s status changes. Some examples are a bell (macOS) and for tasks, displaying a check mark when there are no errors and an X otherwise. Hover the icon to read status information, which may contain actions.

Grouping

Split the terminal by:

Dragging and dropping tabs in the list will rearrange them. Dragging a tab into the main terminal area allows joining a group.

Unsplit a split terminal by triggering the Terminal: Unsplit Terminal command through the Command Palette or in the right-click context menu.

Customizing Tabs

Change the terminal’s name, icon, and tab color via the right-click context menu or by triggering the following commands:

CommandCommand ID
Terminal: Renameworkbench.action.terminal.rename
Terminal: Change Iconworkbench.action.terminal.changeIcon
Terminal: Change Colorworkbench.action.terminal.changeColor

Tip: Go back to the old version by setting terminal.integrated.tabs.enabled:false

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Working directory

By default, the terminal will open at the folder that is opened in the Explorer. The terminal.integrated.cwd setting allows specifying a custom path to open instead:

Split terminals on Windows will start in the directory that the parent terminal started with. On macOS and Linux, split terminals will inherit the current working directory of the parent terminal. This behavior can be changed using the terminal.integrated.splitCwd setting:

There are also extensions available that give more options such as Terminal Here.

Terminal process reconnection

Local and remote terminal processes are restored on window reload, such as when an extension install requires a reload. The terminal will be reconnected and the UI state of the terminals will be restored, including the active tab and split terminal relative dimensions.

Links

The terminal features link detection, showing an underline when files or URLs are hovered with the mouse that will go to the target when Ctrl / Cmd is held. If a file or URL cannot be detected, they are still surfaced as low confidence «workspace search» links, which only show an underline when hovered if the modifier is down. These low confidence links will search the workspace for the term, opening the match if one is found.

Depending on the type of link, activating it will do one of the following:

Extensions make use of links in the terminal, such as GitLens, to identify branches.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Local echo

On some remote connections, there’s a delay between typing and seeing the characters on the terminal as a result of the round trip the data has to make from VS code to the process. Local echo attempts to predict modifications and cursor movements made locally in the terminal to decrease this lag.

Terminal appearance

Customize the terminal’s appearance using the following settings:

Copy & Paste

The keybindings for copy and paste follow platform standards:

Using the mouse

Right-click behavior

The right-click behavior differs based on the platform:

This can be configured using the terminal.integrated.rightClickBehavior setting.

Alt click

Alt left click will reposition the cursor to underneath the mouse. This works by simulating arrow keystrokes, which may fail for some shells or programs. This feature can be disabled.

Keybindings and the shell

Look at the setting details to see the complete list of default commands.

Chord keybindings in the terminal

By default, when a chord keybinding is the highest priority keybinding, it will always skip the terminal shell (bypassing terminal.integrated.commandsToSkipShell ) and be evaluated by VS Code instead of the terminal. This is typically the desired behavior unless you’re on Windows/Linux and want your shell to use ctrl+k (for bash, this cuts the line after the cursor). This can be disabled with the following setting:

Send text via a keybinding

The workbench.action.terminal.sendSequence command can be used to send a specific sequence of text to the terminal, including escape sequences. This enables things like sending arrow keys, enter, cursor moves, etc. For example, the below sequence jumps over the word to the left of the cursor ( Ctrl+Left ) and presses backspace:

Note that the command only works with the \u0000 format for using characters via their character code (not \x00 ). Read more about these hex codes and the sequences terminals work with on the following resources:

Run selected text

To use the runSelectedText command, select text in an editor and run the command Terminal: Run Selected Text in Active Terminal via the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ):

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The terminal will attempt to run the selected text.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If no text is selected in the active editor, the line that the cursor is on is run in the terminal.

Automating launching of terminals

This file could be committed to the repository to share with other developers or created as a user task via the workbench.action.tasks.openUserTasks command.

Next steps

The basics of the terminal have been covered in this document. Read on to find out more about:

Common questions

I’m having problems launching the terminal

There’s a dedicated troubleshooting guide for these sorts of problems.

Why is VS Code shortcut X not working when the terminal has focus?

Currently, the terminal consumes many key bindings, preventing Visual Studio Code from reacting to them. An example of this is Ctrl+B to open the Side Bar on Linux and Windows. This is necessary as various terminal programs and/or shells may respond to these key bindings themselves. Use the terminal.integrated.commandsToSkipShell setting to prevent specific key bindings from being handled by the terminal.

You may refer to Cmder’s wiki for more information.

Why is Cmd+k/Ctrl+k not clearing the terminal?

Normally Cmd+k / Ctrl+k clears the terminal on macOS/Windows, but this can stop working when chord keybindings are added either by the user or extensions. The Cmd+k / Ctrl+k keybindings rely on the VS Code keybinding priority system that defines which keybinding is active at any given time (user > extension > default). To fix this, you need to redefine your user keybinding that will have priority, preferably at the bottom of your user keybindings.json file:

Why is nvm complaining about a prefix option when the integrated terminal is launched?

nvm (Node Version Manager) users often see this error for the first time inside VS Code’s integrated terminal:

This is mostly a macOS problem and does not happen in external terminals. The typical reasons for this are the following:

To resolve this issue, you need to track down where the old npm is installed and remove both it and its out-of-date node_modules. Find the nvm initialization script and run which npm before it runs, which should print the path when you launch a new terminal.

Once you have the path to npm, find the old node_modules by resolving the symlink by running a command something like this:

This will give you the resolved path at the end:

From there, removing the files and relaunching VS Code should fix the issue:

Can I use Powerline fonts in the integrated terminal?

Yes. Specify Powerline fonts with the terminal.integrated.fontFamily setting.

Note that you want to specify the font family, not an individual font like Meslo LG M DZ Regular for Powerline where Regular is the specific font name.

How do I configure zsh on macOS to jump words with Ctrl+Left/Right arrow?

By default, Ctrl+Left/Right arrow will jump words in bash. Configure the same for zsh by adding these keybindings:

Why does macOS make a ding sound when I resize terminal split panes?

The keybindings ⌃⌘← and ⌃⌘→ are the defaults for resizing individual split panes in the terminal. While they work, they also cause a system «invalid key» sound to play due to an issue in Chromium. The recommended workaround is to tell macOS to no-op for these keybindings by running this in your terminal:

Why is my terminal showing a multi-colored triangle or a completely black rectangle?

I’m having problems with the terminal rendering. What can I do?

By default, the integrated terminal will render using GPU acceleration on most machines. It does this using multiple elements, which are better tuned than the DOM for rendering interactive text that changes often. The terminal features 3 renderers that fallback if they are detected to perform poorly in this order:

Unfortunately, some issues cannot be automatically detected. If you experience issues with the GPU acceleration, you can disable terminal.integrated.gpuAcceleration in your user or workspace settings, which will use the DOM renderer. This can be driven by the following setting:

I see 1

when I paste something

This normally means that the program/shell running inside the terminal requested to turn on «bracketed paste mode» but something doesn’t support it properly. To workaround this you could run printf «\e[?2004l» to disable it for that session of add the following to your

Ctrl+A, Ctrl+R output ^A, ^R on zsh

To workaround this you have two options:

Why are the colors in the terminal not correct?

One of our accessibility features we enable by default is to ensure a minimum contrast ratio of at least 4.5 is met for the foreground text. This feature ensures that text is readable regardless of the shell and theme used which is not possible otherwise. To disable this feature you can set:

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Installing Microsoft Visual Studio Code on Linux

Brief: Microsoft’s open source code editor Visual Studio Code is awesome. Learn how to install Visual Studio Code in Ubuntu and other Linux distributions.

Microsoft did the unexpected by releasing Visual Studio Code for all major desktop platforms that includes Linux as well. Soon after its release Microsoft Visual Code became one of the best open source code editors. The feature it provides are useful not only to web developers but for other languages too.

I am not going to list the features of Visual Studio Code here. I presume you already know them. So, here, I am going to show you how to install Visual Studio Code on Ubuntu and other Linux distributions.

Installing Visual Studio Code in Ubuntu and other Linux distributions

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Let’s see how to install Visual Studio Code!

Method 1: Install Visual Studio Code in Linux using Snap

Visual Studio Code is available as a Snap package. Ubuntu users can find it in the Software Center itself and install it in a couple of clicks.

Snap packaging means you can install it in any Linux distribution that supports Snap packages. Make sure to enable Snap support on your Linux distribution if you haven’t done already.

If you don’t have snap packages listed on your software center or app center, you can install VS Code using this command:

Snaps are special kind of packages that are usually big in size. So it will take some time in downloading and installing the Snap package depending upon your internet speed.

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download-300×173.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download.png» width=»800″ height=»462″ src=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download.png» alt=»Visual Studio Download» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download.png 800w, https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download-300×173.png 300w, https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download-768×444.png 768w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-download.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″>

There are options for 32-bit systems as well. If you’re not sure about that, you can read our guide to find if your Ubuntu is 32 bit or 64 bit and then download the files accordingly.

Method 3: Using Flatpak

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak-300×124.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak.png» width=»800″ height=»331″ src=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak.png» alt=»Visual Studio Code Flatpak» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak.png 800w, https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak-300×124.png 300w, https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak-768×318.png 768w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2020/06/visual-studio-code-flatpak.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Visual Studio Code Flatpak

In my case, Pop OS 20.04 has Flatpak support enabled out-of-the-box. But, in case you’re not aware of Flatpak, I’d suggest you to refer to our guide to use Flatpak on Linux.

Of course, if you have Flatpak support on your software store, you can simply look for the Visual Studio Code and get it installed.

But, if you don’t have the support, you need to add Flatpak support and then type in the following command:

You can use umake command below to install Visual Studio Code:

You’ll be asked to provide a path where it will be installed:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After throwing a whole lot of terms and conditions, it will ask for your permission to install Visual Studio Code. Press ‘a’ at this screen:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Once you do that it will start downloading and installing it. Once it is installed, you can see that Visual Studio Code icon has already been locked to the Unity Launcher. Just click on it to run it. This is how Visual Studio Code looks like in Ubuntu 15.04 Unity:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

As a last resort, you can always build it from the source code. You can find the source code of VS Code on its GitHub page.

It’s pretty easy to install Visual Studio Code in Ubuntu with the help of snap, flatpak, or deb/rpm packages available.

Now, that you know — what method do you prefer to install Microsoft’s Visual Studio Code on Linux?

Feel free to let me know your thoughts in the comments below!

Creator of It’s FOSS. An ardent Linux user & open source promoter. Huge fan of classic detective mysteries ranging from Agatha Christie and Sherlock Holmes to Detective Columbo & Ellery Queen. Also a movie buff with a soft corner for film noir.

Background

Last week I worked on a project, which involved developing software in C#. I heard about C#, but never actually coded in C# before this project. It surprised me how quickly I found my way around the C# programming language. C# feels like it combines all the good things of Java and Object Pascal, mixed with the familiar syntax of C. As a true Linux aficionado, I wondered: “Can I develop C# software on Linux”?

What do you need

The only thing you need, while working your way through this article, is a Linux system with desktop environment. It can be an actual PC or a virtual machine. Personally, I prefer trying things out on a virtual machine first. For this reason I decided on using Ubuntu 20.04 Budgie, running as a virtual machine in VirtualBox. This means the instructions target Ubuntu 20.04. However, I’ll include links and references in case you run a different Linux distribution.

Install Visual Studio Code on Linux

According to the Visual Studio Code website, you can install Visual Studio Code in two different ways:

My personal preference goes out to option two. Snap packages themselves are fine. I just don’t like it that they update in the background, without you knowing about it. It gives me Windows 10 flashbacks. But that’s just me.

To install Visual Studio Code through the Debian or Ubuntu package manager, we can download the DEB package from the Visual Studio Code website. Download the RPM package instead, if you run Fedora or openSUSE.

Download the Visual Studio Code editor DEB package

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After the download completes, the DEB package shows up in your

/Downloads directory. In my case its name is code_1.54.3-1615806378_amd64.deb :

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Install the Visual Studio Code editor DEB package

To install the downloaded Visual Studio Code DEB package, open up the terminal and run the following command. Just remember to adjust the name of the DEB file, in case it has a different filename on your system.

/Downloads/code_1.54.3-1615806378_amd64.deb

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you are new to directly installing DEB packages, refer to the tutorial about manually installing a DEB package on Debian or Ubuntu.

Install the C# for Visual Studio Code extension

By default, Visual Studio Code for Linux does not yet support C#. Luckily we can add C# support to Visual Studio Code by installing an extension. You can find the C# extension (and other extensions) on the Visual Studio Code market place website. Open this link in your web browser to go directly to the C# extension page:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The C# extension web page tells us exactly how to install the extension. Go ahead and start Visual Studio Code. The installer automatically added an application launcher to your application menu:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Once opened, press CTRL + P on the keyboard. An edit box pops up. Enter (or copy/paste) the text ext install ms-dotnettools.csharp into this edit box and press ENTER on the keyboard:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Install required dependencies

Create a C# console application with Visual Studio Code

Create a new C# project

Start Visual Studio Code and select TerminalNew Terminal from the program menu. From the new terminal window, we can create a C# console application by running these commands:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Build and run the C# application

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Before we can build the C# application, we need to configure the so called default build task. From the program menu, select TerminalConfigure Default Build Task. A small menu with available build tasks appears. Select build from this menu:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

With the default build task configured, we can build our C# application by selecting TerminalRun Build Task from the program menu. Alternatively, you can press CTRL + SHIFT + B on the keyboard. You can follow the build progress in the terminal window.

With the C# application built, you can run it by selecting RunRun Without Debugging from the program menu. If you prefer keyboard shortcuts, you can press CTRL + F5 instead. The output of the console application appears in the Debug Console window:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note that the C# application automatically builds before it runs, so there is no need to always explicitly build it first.

Debug the C# application

No integrated development environment is complete without debugging capabilities. Luckily, our solution with Visual Studio Code for developing C# applications on Linux, offers build-in debugging functionality. For example, to set a breakpoint, simply click on the left side of the line number in the editor. A red dot appears, indicating that a breakpoint is active for that line:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To start a new debug session, select RunStart Debugging from the program menu or press F5 on the keyboard:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Wrap up

In this article we setup a fully functional integrated development environment for C# on Linux. In a nutshell, we completed these steps:

To take the development environment for a test ride, we created a Hello World type C# console application. Afterwards, we learned how to build, run and debug the C# console application, all from within Visual Studio Code on our Linux system. Now it’s up to you to unleash your creativity and start coding in C#.

If you enjoyed this article and developing with Visual Studio Code, you might also be interested in the article about how to import a CMake project into Visual Studio Code.

PragmaticLinux

Long term Linux enthusiast, open source software developer and technical writer.

Getting Started With Microsoft Visual Studio Code on Linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Microsoft Visual Studio is one of the most powerful integrated development environments available, with one downside: it’s only available for Windows. In order to attract Linux and Mac users to the Visual Studio family of development tools, Microsoft recently launched Visual Studio Code (or VSCode for short)—a truly cross-platform code editor that is both fast and light-weight.

VSCode works equally well on Linux, Mac, and Windows. However, because Microsoft Visual Studio 2013 itself is available on Windows, VSCode is most likely to see more adoption among Linux and Mac users who, until now, had to make do with simpler alternatives such as Sublime Text, Atom or Komodo Edit for web development.

Here are some features that might make VSCode a compelling alternative to your present code editor:

In most of the other popular code editors, these features are only available after you install the appropriate plugins manually—if they are available at all.

In this tutorial, I’m going to show you how to install and use VSCode on Ubuntu, one of the most popular Linux distros.

Note: if you’re a Windows user, you can still follow this tutorial by skipping all the command-line installations. You just have to use the Windows installer instead, which sets everything up for you.

Prerequisites

In order to follow this tutorial, you’re going to need:

Installation

Create a directory for VSCode.

Enter that directory, and use wget to download VSCode.

Create a link to the executable named Code inside /usr/local/bin/ so that it can be run from any directory.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Creating a Project

/JustAnotherApp as a project, you could type in:

If your project doesn’t have any files yet, here’s what you will see:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You can now click on the name of your project to see buttons that let you create new files and folders:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Using IntelliSense

IntelliSense is an umbrella term used by Microsoft that covers features such as automatic code completion and context-aware code suggestions. These are really helpful for increasing productivity, especially when you are using a new API or library. In the present preview release of VSCode, IntelliSense is available on all platforms for JavaScript, CSS, HTML and a few other languages. In this tutorial, I’ll show you how to use it in your Node.js projects.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Similarly, pressing Control+Space in your Javascript files, you can see the fields and methods available in certain common classes and objects.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To solve this problem, you need the relevant TypeScript type definitions. To get these definitions, you can use TSD (TypeScript Definition manager for DefinitelyTyped), an npm module.

If you don’t have it already, install it from the terminal using:

Now, inside your project directory, you can use tsd to install the type definitions you want. For example, to install the type definitions for the Express framework, you have to type in the following:

You can now press Control+Space to see that suggestions are available for objects that belong to the Express framework:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debugging

Though it works out of the box on Windows, on Ubuntu (and most other Linux distros and Mac OS X), you need to install Mono 3.10.0 or higher for the debugger to work. Without it, trying to start the debugger will fail:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To install the latest version of Mono, you need to add a new PPA to Ubuntu’s software sources. Do so by opening a terminal and typing in:

Finally, create a link to the mono executable inside /usr/bin :

Return to VSCode and start the debug again. You should see it working:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Using Version Control

On all platforms, VSCode supports version control with Git. To use this feature, you need to have Git installed on your computer. On Ubuntu, you can install Git by opening a terminal again and typing in the following:

Go back to VSCode, and click on the Git button in the toolbar. You’ll be prompted to initialize a new repository:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Once initialized, VSCode shows you all the files that need to be committed or updated. Committing is as simple as typing in a commit message and clicking on the check mark:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Using Markdown Preview

On all platforms, VSCode supports Markdown preview, and it works without any additional installations. When you are editing a markdown file, pressing Control+Shift+V at any time will display a preview of the file.

For example, if your Markdown file looks like this:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

… the preview will show this:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Conclusion

You now know how to install and run Visual Studio Code—the first development tool from Microsoft’s Visual Studio family that supports Linux—on your Ubuntu system. Though the set up process is slightly involved, you should give it a try in order to experience its slick and streamlined interface that’s optimized for web development.

As of May 2015, VSCode was still in preview, with improvements and new features likely to appear in following months. Updates are easy to install, and are available for all platforms at the same time.

If you have any questions or comments about this guide, please let me know. Have you tried VSCode already? If so, what did you think?

Share This Article

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Hathibelagal is an independent developer and blogger who loves tinkering with new frameworks, SDKs, and devices. Read his blog here.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

VS Code Remote Development

Visual Studio Code Remote Development allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. You can:

No source code needs to be on your local machine to get these benefits. Each extension in the Remote Development extension pack can run commands and other extensions directly inside a container, in WSL, or on a remote machine so that everything feels like it does when you run locally.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Getting started

Remote Development extension pack

The Remote Development extension pack includes three extensions. See the following articles to get started with each of them:

While most VS Code extensions should work unmodified in a remote environment, extension authors can learn more at Supporting Remote Development.

Remote tutorials

The tutorials below will walk you through running Visual Studio Code with the Remote Development extensions.

TutorialDescription
Remote via SSHConnect to remote and virtual machines with Visual Studio Code via SSH.
Work in WSLRun Visual Studio Code in Windows Subsystem for Linux.
Develop in ContainersRun Visual Studio Code in a Docker Container.
GitHub CodespacesConnect to a codespace with Visual Studio Code.

GitHub Codespaces

GitHub Codespaces provides remote development environments that are managed for you. You can configure and create a development environment hosted in the cloud, which is spun up and available when you need it.

Learning with VS Code on Chromebooks

December 3, 2020 by Alessandro Segala, @ItalyPaleAle

For the last few years, Chromebooks running Google Chrome OS have been providing an alternative to «traditional» laptops. Thanks to lots of choices, from very affordable models to high-end ones, Chromebooks are especially popular among students, who can use them for learning, completing assignments, and attending classes virtually.

While Chromebooks and Chrome OS are typically centered around the web browser, you can also enable a Linux environment that allows installing native desktop applications, including Visual Studio Code!

With VS Code running on your Chromebook, you can start coding easily and quickly in a variety of languages and frameworks. This includes languages such as Python, JavaScript and Node.js, Java, and C#, among many more!

In this article, the first of two, we’ll look at how to install Visual Studio Code on a Chromebook and how to set up an environment to start coding in Python or JavaScript/Node.js. In a later post, we’ll also look at how to leverage the Remote Development extensions for VS Code to connect to more powerful development environments.

What you’ll need

VS Code runs on any recent Chromebook, as long as you are able to enable Linux applications via Crostini, which we’ll look at how to do in just a moment.

Visual Studio Code is a lightweight editor, so you will be able to run it on low-powered Chromebooks, with a minimum of 1 GB of RAM. In addition, VS Code is now available for Linux on ARMv7 and ARM64, which means that you can run it on Chromebooks powered by an ARM chip as well!

For this tutorial, I’ll be using an entry-level Chromebook, with an ARM64 CPU, 4 GB of RAM, and a 32 GB-disk. Despite the modest specs, VS Code runs just fine on this machine!

Enable Linux on your Chromebook

Before we can install VS Code on Chrome OS, we need to enable support for native Linux apps, using Crostini.

First, open your system’s Settings, then look for Linux (Beta) on the sidebar. From there, turn on Linux support.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Follow the instructions on screen to configure the Linux environment (for most people, accepting the default values should be enough). Your Chromebook will then download the tools to create the Linux environment and configure it for you. Behind the scenes, this is actually creating a container running Debian 10, so you get a full Linux distribution to play with!

Once the Linux environment has been set up, you’ll see a new terminal window popping up.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The output will be similar to this:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

As soon as the second command ends, you can move to the next step.

Install VS Code

We’re now ready to install VS Code!

Go to the Visual Studio Code Download page. From there, you need to pick the right package for your Chromebook:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After you’ve downloaded VS Code, you’ll find the package in your Downloads folder. Double-click on the package to launch the installer:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Your Chromebook will then install VS Code and all other dependencies.

After the installation is complete, in your list of apps, you’ll find Visual Studio Code inside a folder called Linux apps (along with the Linux terminal). You can now launch VS Code.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You should see VS Code running, and at this point you’re ready to start coding!

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you’re new to VS Code and want to know how to use the editor, here are some resources for you to explore:

Code with JavaScript and Node.js

JavaScript is a very flexible programming language, that can be used to build apps running inside a web browser and on web servers with Node.js. Nowadays, JavaScript is also being used to build native desktop apps (Electron) and mobile apps (Apache Cordoba, React Native, etc.), programming Internet-of-Things (IoT) devices, and much more.

Tip: If you want to learn JavaScript, there is a free video series our colleagues made: Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual Studio Code is a very popular editor for coding with JavaScript and Node.js (State of JS survey), and supports JavaScript natively.

However, in order to use Node.js (and JavaScript in general) on your Chromebook, you’ll have to install the Node.js runtime. To do that, we’re going to use nvm, a small open-source utility that makes it easier to install Node.js and update it.

To install nvm, run the following commands inside the Linux terminal:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

After you have nvm installed, you can install the latest version of Node.js with this command:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Tip: Did you know that VS Code contains an integrated terminal? You can launch it from the Terminal menu and then New Terminal. VS Code is running in the context of the Linux environment, so the integrated terminal is also running in Linux.

nvm offers quite a few options to set up, update, and manage Node.js. If you’re interested, you can read more in the official documentation for nvm.

Code with Python

Python is another popular programming language, and it’s especially great for beginners. With Python, you can build apps for the web, desktop, and command line. Python is one of the best-suited languages for working with data science and Artificial Intelligence (AI), and it’s also used to program IoT devices, microcontrollers, and more!

VS Code is an excellent editor for coding Python and learning the language. You can use Python in VS Code both for building apps of every kind and for working with notebooks, such as those used by data scientists.

Tip: If you’re looking at getting started with Python, there is a free video series for you as well: Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Chrome OS already comes with the Python 3 interpreter pre-installed, but we need to install a few more packages to get the best Python coding experience. This includes pip (a dependency manager for Python), venv (for managing Python virtual environments), and some build tools for working with native packages. In the terminal, run:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Python support in VS Code is provided through the Microsoft Python extension. To install the Python extension, from within VS Code, use the left Activity bar to open the Extensions view ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ), then search for «python» and install the extension provided by Microsoft:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

At this point, you’re ready to start developing with Python in VS Code! To learn more about using Python with VS Code, including running your code, using the integrated debugger, linting, etc., check out our documentation for Python in VS Code.

Coming next: using Remote Development

That’s all for today! In this post, we looked at how to install VS Code on a Chromebook and how to get started with coding in JavaScript/Node.js and Python.

But wait, there’s more. While Chromebooks can run VS Code just fine, even on lower-powered versions like the one I’m testing with, sometimes you need to use faster machines for your development, with more memory and/or a faster CPU. For example, maybe you’re using an ARM-powered Chromebook but you need to run your code on a Intel/AMD chip. Or maybe you want to work with Artificial Intelligence and need access to machines with powerful GPUs.

With VS Code and the Remote Development extensions (SSH and Container), as well as GitHub Codespaces, we can solve all of the problems above–and more.

In the next part of this tutorial, you’ll learn how VS Code Remote extensions and GitHub Codespaces can turn your Chromebook into a development powerhouse!

In the meanwhile, happy coding… and happy learning!

Alessandro Segala, VS Code Product Manager @ItalyPaleAle

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Hello World

Now return to your Ubuntu terminal (or use the Visual Studio Code terminal window) and type the following to install a server defined by the above specifications detailed in package.json:

Finally, type the following to launch the web server:

You can now navigate to localhost:10001 in your native Windows web browser by using CTRL+Left Click on the terminal links.

By using Ubuntu on WSL you’re able to take advantage of the latest Node.js packages available on Linux as well as the more streamlined command line tools.

7. Enjoy Ubuntu on WSL!

That’s all folks! In this tutorial, we’ve shown you how to connect the Windows version of Visual Studio Code to your Ubuntu on WSL filesystem and launch a basic Node.js webserver.

We hope you enjoy using Ubuntu inside WSL. Don’t forget to check out our other tutorials for tips on how to optimise your WSL setup for Data Science.

Setting up Visual Studio Code

Getting up and running with Visual Studio Code is quick and easy. It is a small download so you can install in a matter of minutes and give VS Code a try.

Cross platform

VS Code is a free code editor, which runs on the macOS, Linux, and Windows operating systems.

Follow the platform-specific guides below:

VS Code is lightweight and should run on most available hardware and platform versions. You can review the System Requirements to check if your computer configuration is supported.

Update cadence

VS Code releases a new version each month with new features and important bug fixes. Most platforms support auto updating and you will be prompted to install the new release when it becomes available. You can also manually check for updates by running Help > Check for Updates on Linux and Windows or running Code > Check for Updates on macOS.

Note: You can disable auto-update if you prefer to update VS Code on your own schedule.

Insiders nightly build

If you’d like to try our nightly builds to see new features early or verify bug fixes, you can install our Insiders build. The Insiders build installs side-by-side with the monthly Stable build and you can freely work with either on the same machine. The Insiders build is the same one the VS Code development team uses on a daily basis and we really appreciate people trying out new features and providing feedback.

Portable mode

Visual Studio Code supports Portable mode installation. This mode enables all data created and maintained by VS Code to live near itself, so it can be moved around across environments, for example, on a USB drive. See the VS Code Portable Mode documentation for details.

Additional components

VS Code is an editor, first and foremost, and prides itself on a small footprint. Unlike traditional IDEs that tend to include everything but the kitchen sink, you can tune your installation to the development technologies you care about. Be sure to read the Additional Components topic after reading the platform guides to learn about customizing your VS Code installation.

Extensions

VS Code extensions let third parties add support for additional:

Extensions integrate into VS Code’s UI, commands, and task running systems so you’ll find it easy to work with different technologies through VS Code’s shared interface. Check out the VS Code extension Marketplace to see what’s available.

Next steps

Once you have installed and set up VS Code, these topics will help you learn more about VS Code:

If you’d like to get something running quickly, try the Node.js tutorial walkthrough that will have you debugging a Node.js web application with VS Code in minutes.

Common questions

What are the system requirements for VS Code?

How big is VS Code?

VS Code is a small download ( New Project dialog or pre-installed project templates. You’ll need to add additional components and scaffolders depending on your development interests. With scaffolding tools like Yeoman and the multitude of modules available through the npm package manager, you’re sure to find appropriate templates and tools to create your projects.

How do I know which version I’m running?

On Linux and Windows, choose Help > About. On macOS, use Code > About Visual Studio Code.

Why is VS Code saying my installation is Unsupported?

VS Code has detected that some installation files have been modified, perhaps by an extension. Reinstalling VS Code will replace the affected files. See our FAQ topic for more details.

How can I do a ‘clean’ uninstall of VS Code?

The folder locations will vary depending on your platform:

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Visual Studio Code

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual Studio Code — функциональный редактор кода от компании Microsoft.

Возможности

Visual Studio Code (VS code) имеет встроенную поддержку языков JavaScript, TypeScript, Node.js, а также большое количество дополнительно подключаемых языков, среди которых: C/C++, C#, Java, Python, PHP, Ruby, Rust, Go, Swift, HTML, XML и другие.

Некоторые возможности программы:

Интерфейс

Visual Studio Code имеет современный не перегруженный и отзывчивый интерфейс. Вся работа ведется внутри главного окна. Оно разделяется на различные области. Новые окна открываются, как новая область или как всплывающие вспомогательные окна.

По умолчанию установлена темная тема оформления. Доступно несколько различных тем, от светлых до темных.

Модули

Для Visual Studio Code существуют различные модули, которые позволяют добавить поддержку других языков программирования, а также повысить функциональность программы.

Разработка

Программа кроссплатформенная, переведена на русский язык.

Распространяется бесплатно, имеет открытый исходный код (Open Source). Но готовые сборки являются проприетарными.

Установка Visual Studio Code в Linux

Для установки Visual Stduio Code в Linux можно использовать готовые пакеты DEB или RPM, доступные на официальном сайте программы.

Есть версии для 32-х и 64-х битных систем.

Видео (установка и превью программы):

Remote development in WSL

Prerequisites

Install the extension

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Prerequisite check

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Enable WSL

Windows Subsystem for Linux (WSL) is an optional feature on Windows 10. You can enable it through the Windows Features dialog or PowerShell.

Windows Features dialog

In the Windows search bar, type ‘features’ to bring up the Turn Windows Features on and off dialog. Scroll down and check Windows Subsystem for Linux.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select OK and you will be prompted to restart Windows.

PowerShell

If you prefer, you can open PowerShell as an Administrator and type:

After the command runs, you will be prompted to restart Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Check WSL

After restarting Windows, you can check that you have WSL enabled by opening a Command Prompt and typing ‘wsl’.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

WSL is enabled, but you haven’t installed a Linux distribution yet.

Install a Linux distro

You install Linux distributions for WSL from the Microsoft Store. You can use the store app, or search for a Linux distro in the Windows search bar. Choose the Linux distribution you want to install (for example Ubuntu) and follow the prompts.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Select Install.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

And when done, select Launch to get started. This will open a Linux terminal and complete the installation. You’ll need to create a user ID and password since you are setting up a full Linux instance. You are now running Linux on Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Python development

If you don’t have Python already installed, run the following commands to install Python3 and pip, the package manager for Python, into your Linux installation.

And to verify, run:

Start with the canonical «Hello World» app. Create a new folder called «helloWorld» and then add a Python file that will print a message when run:

In a remote Linux environment (this WSL distro is technically another machine without UI, that just happens to be running locally on your computer), your development tools and experiences are pretty limited. You can run Vim in the terminal to edit your file, or you can edit the sources on the Windows side through the \\wsl$ mount:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The problem with this model is that the Python runtime, pip, or any conda packages for that matter, are not installed on Windows.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Remember, Python is installed in the Linux distro, which means if you’re editing Python files on the Windows side, you can’t run or debug them unless you install the same Python development stack on Windows. And that defeats the purpose of having an isolated Linux instance set up with all your Python tools and runtimes!

Run in WSL

Note: If this command does not work, you may need to restart your terminal, or you may not have added VS Code to your path when it was installed.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The first thing you’ll see is a message about «Installing VS Code Server» (the c7d83e57… number is the version of the VS Code Server that matches the client-side tools you just installed). VS Code is installing a small server on the Linux side that the desktop VS Code will then talk to. That server will then install and host extensions in WSL, so that they run in the context of the tools and frameworks installed in WSL. In other words, your language extensions will run against the tools and frameworks installed in WSL, not against what is installed on the Windows side, as it should for the proper development experience.

The next thing that happens is VS Code will start and open the helloWorld folder. You may see a quick notification telling you that VS Code is connecting to WSL, and you may be prompted to allow access to the Node.js-based server.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Integrated Terminal

Run Terminal > New Terminal ( ⌃` (Windows, Linux Ctrl+` ) ) to open a new terminal instance.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll start a new instance of the bash shell in WSL, again from VS Code running on Windows.

Tip: In the lower left corner of the Status Bar, you can see that you’re connected to your WSL: Ubuntu instance.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Edit and debug

Installing the Python extension (and additional tools)

Click on hello.py to open it for editing. You will be prompted with an extension recommendation, in this case to install the Microsoft Python extension, which will give you rich editing and debugging experiences. Go ahead and select Install and reload if prompted.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

To prove that the extension is installed in WSL, open the Extensions view again ( ⇧⌘X (Windows, Linux Ctrl+Shift+X ) ). You will see a section titled WSL: Ubuntu – Installed, and you can see any extensions that are installed on the WSL side.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Upon reload, you’ll also get prompted telling you that the pylint linter is not installed. Linters are used to show errors and warnings in source code. Go ahead and select Install.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Now, when you edit your code, you get rich colorization and completions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

And when you save your file ( ⌘S (Windows, Linux Ctrl+S ) ), you’ll get linting errors and warnings on the file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debugging

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Now, press F5 to run your application. You will be asked how to run the application, and since this is a simple file, just choose Python File.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The app will start, and you’ll hit the breakpoint. You can inspect variables, create watches, and navigate the call stack.

Press F10 to step and you’ll see the output of the print statement in the debug console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You get the full development experience of Visual Studio Code, using the Linux instance installed in WSL.

If you want to open another folder in WSL, open the File menu and choose Open Folder. You’ll get a minimal file and folder navigator for the Linux file system, not the Windows file system.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If you want to switch back to the Windows, select the Show Local option and you’ll get the standard Windows File Open dialog.

Ending your WSL connection

You can end your session in WSL and go back to running VS Code locally with File > Close Remote Connection.

Congratulations

Congratulations, you’ve successfully completed this tutorial!

Next, check out the other Remote Development extensions.

Or get them all by installing the Remote Development Extension Pack.

Remote Development using SSH

No source code needs to be on your local machine to gain these benefits since the extension runs commands and other extensions directly on the remote machine.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Getting started

Note: After reviewing this topic, you can get started with the introductory SSH tutorial.

System requirements

Local: A supported OpenSSH compatible SSH client must also be installed.

Remote SSH host: A running SSH server on:

Other glibc based Linux distributions for x86_64, ARMv7l (AArch32), and ARMv8l (AArch64) should work if they have the needed prerequisites. See the Remote Development with Linux article for information prerequisites and tips for getting community supported distributions up and running.

While ARMv7l (AArch32) and ARMv8l (AArch64) support is available, some extensions installed on these devices may not work due to the use of x86 native code in the extension.

Installation

To get started, you need to:

Install an OpenSSH compatible SSH client if one is not already present.

SSH host setup

If you do not have an SSH host set up, follow the directions for Linux, Windows 10 / Server (1803+), or macOS SSH host or create a VM on Azure.

Optional: If your Linux or macOS SSH host will be accessed by multiple users at the same time, consider enabling Remote.SSH: Remote Server Listen On Socket in VS Code User settings for improved security.

In the Settings editor:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

See the Tips and Tricks article for details.

Optional: While password-based authentication is supported, we recommend setting up key based authentication for your host. See the Tips and Tricks article for details.

Connect to a remote host

To connect to a remote host for the first time, follow these steps:

Verify you can connect to the SSH host by running the following command from a terminal / PowerShell window replacing user@hostname as appropriate.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Once you select a platform, it will be stored in VS Code settings under the remote.SSH.remotePlatform property so you can change it at any time.

Tip: Connection hanging or failing? See troubleshooting tips for information on resolving common problems.

If you see errors about SSH file permissions, see the section on Fixing SSH file permission errors.

After you are connected, you’ll be in an empty window. You can always refer to the Status bar to see which host you are connected to.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Clicking on the Status bar item will provide a list of remote commands while you are connected.

You can then open any folder or workspace on the remote machine using File > Open. or File > Open Workspace. just as you would locally!

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

From here, install any extensions you want to use when connected to the host and start editing!

Note: On ARMv7l / ARMv8l glibc SSH hosts, some extensions may not work due to x86 compiled native code inside the extension.

Open a folder on a remote SSH host in a container

Disconnect from a remote host

To close the connection when you finish editing files on the remote host, choose File > Close Remote Connection to disconnect from the host. The default configuration does not include a keyboard shortcut for this command. You can also simply exit VS Code to close the remote connection.

Remember hosts and advanced settings

If you have a set of hosts you use frequently or you need to connect to a host using some additional options, you can add them to a local file that follows the SSH config file format.

To make setup easy, the extension can guide you through adding a host without having to hand edit this file.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll then be asked to enter the SSH connection information. You can either enter a host name:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Or the full ssh command you would use to connect to the host from the command line:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Finally, you’ll be asked to pick a config file to use. You can also set the «remote.SSH.configFile» property in your User settings.json file if you want to use a different config file than those listed. The extension takes care of the rest!

/.ssh/id_rsa-remote-ssh yourname@remotehost.yourcompany.com in the input box would generate this entry:

See Tips and Tricks for details on generating the key shown here. You can manually edit this file with anything the SSH config file format supports, so this is just one example.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

The Remote Explorer allows you to both open a new empty window on the remote host or directly open a folder you previously opened. Expand the host and click on the Open Folder icon next to the folder you want to open on the host.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Managing extensions

VS Code runs extensions in one of two places: locally on the UI / client side, or remotely on the SSH host. While extensions that affect the VS Code UI, like themes and snippets, are installed locally, most extensions will reside on the SSH host. This ensures you have smooth experience and allows you to install any needed extensions for a given workspace on an SSH host from your local machine. This way, you can pick up exactly where you left off, from a different machine complete with your extensions.

If you install an extension from the Extensions view, it will automatically be installed in the correct location. Once installed, you can tell where an extension is installed based on the category grouping.

There will be a category for your remote SSH host:

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Note: If you are an extension author and find that your extension is not working properly or installs in the wrong place, see Supporting Remote Development for details.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

«Always installed» extensions

Advanced: Forcing an extension to run locally / remotely

Extensions are typically designed and tested to either run locally or remotely, not both. However, if an extension supports it, you can force it to run in a particular location in your settings.json file.

For example, the setting below will force the Docker extension to run locally and Debugger for Chrome extension to run remotely instead of their defaults:

A value of «ui» instead of «workspace» will force the extension to run on the local UI/client side instead. Typically, this should only be used for testing unless otherwise noted in the extension’s documentation since it can break extensions. See the article on Supporting Remote Development for details.

Forwarding a port / creating SSH tunnel

Sometimes when developing, you may need to access a port on a remote machine that is not publicly exposed. There are two ways to do this using an SSH tunnel that «forwards» the desired remote port to your local machine.

Temporarily forwarding a port

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

You’ll be asked to enter the port you would like to forward and you can give it a name.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

This same information is available in the Forwarded Ports section of the Remote Explorer if you need to access it later.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Change local port on tunnel

If you would like the local port of the tunnel to be different than the remote server’s, you can change this via the Forwarded Ports panel.

Right-click the tunnel you want to modify, and select Change Local Port in the context menu.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Always forwarding a port

If you have ports that you always want to forward, you can use the LocalForward directive in the same SSH config file you use to remember hosts and advanced settings.

For example, if you wanted to forward ports 3000 and 27017, you could update the file as follows:

Opening a terminal on a remote host

Opening a terminal on the remote host from VS Code is simple. Once connected, any terminal window you open in VS Code (Terminal > New Terminal) will automatically run on the remote host rather than locally.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Debugging on the SSH host

Once you are connected to a remote host, you can use VS Code’s debugger in the same way you would when running the application locally. For example, if you select a launch configuration in launch.json and start debugging ( F5 ), the application will start on remote host and attach the debugger to it.

SSH host-specific settings

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Working with local tools

SSHFS is the most convenient option and does not require any file sync’ing. However, performance will be significantly slower than working through VS Code, so it is best used for single file edits and uploading/downloading content. If you need to use an application that bulk reads/write to many files at once (like a local source control tool), rsync is a better choice.

Known limitations

Docker Extension limitations

Extension limitations

Many extensions will work on remote SSH hosts without modification. However, in some cases, certain features may require changes. If you run into an extension issue, there is a summary of common problems and solutions that you can mention to the extension author when reporting the issue.

In addition, some extensions installed on ARMv7l (AArch322) / ARMv8l (AArch64) devices may not work due to native modules or runtimes in the extension that only support x86_64. In these cases, the extensions would need to opt-in to supporting these platforms by compiling / including binaries for ARMv7l / ARMv8l.

Common questions

See Installing a supported SSH server for details on setting up an SSH server for your host.

Can I sign in to my SSH server with another/additional authentication mechanism like a password?

Yes, you should be prompted to enter your token or password automatically. However, passwords are not saved, so using key based authentication is typically more convenient.

How do I fix SSH errors about «bad permissions»?

See Fixing SSH file permission errors for details on resolving these types of errors.

What Linux packages / libraries need to be installed on remote SSH hosts?

What are the connectivity requirements for the VS Code Server when it is running on a remote machine / VM?

Installation of VS Code Server requires that your local machine has outbound HTTPS (port 443) connectivity to:

You can install extensions manually without an internet connection using the Extensions: Install from VSIX. command, but if you use the extension panel to install extensions, your local machine and VS Code Server server will need outbound HTTPS (port 443) access to:

All other communication between the server and the VS Code client is accomplished through the authenticated, secure SSH tunnel.

Can I use local tools on source code sitting on the remote SSH host?

Yes. Typically this is done using SSHFS or by using rsync to get a copy of the files on your local machine. SSHFS mounts the remote filesystem is ideal for scenarios where you need to edit individual files or browse the source tree and requires no sync step to use. However, it is not ideal for using something like a source control tool that bulk manages files. In this case, the rsync approach is better since you get a complete copy of the remote source code on your local machine. See Tips and Tricks for details.

Can I use VS Code when I only have SFTP/FTP filesystem access to my remote host (no shell access)?

Some cloud platforms only provide remote filesystem access for developers rather than direct shell access. VS Code Remote Development was not designed with this use case in mind since it negates the performance and user experience benefits.

However, this use case can typically be handled by combining extensions like SFTP with remote debugging features for Node.js, Python, C#, or others.

As an extension author, what do I need to do?

The VS Code extension API abstracts away local/remote details so most extensions will work without modification. However, given extensions can use any node module or runtime they want, there are situations where adjustments may need to be made. We recommend you test your extension to be sure that no updates are required. See Supporting Remote Development for details.

Arch Linux User Repository

Search Criteria

Package Details: visual-studio-code-bin 1.70.2-1

Package Actions

Git Clone URL:https://aur.archlinux.org/visual-studio-code-bin.git (read-only, click to copy)
Package Base: visual-studio-code-bin
Description:Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)
Upstream URL:https://code.visualstudio.com/
Licenses:custom: commercial
Conflicts:code
Provides:code, vscode
Submitter:dcelasun
Maintainer:dcelasun
Last Packager:dcelasun
Votes:1240
Popularity:20.98
First Submitted:2017-12-18 19:14 (UTC)
Last Updated:2022-08-17 18:50 (UTC)

Dependencies (16)

Required by (18)

Sources (8)

Pinned Comments

dcelasun commented on 2017-11-15 06:20 (UTC) (edited on 2020-02-06 21:33 (UTC) by dcelasun)

FREQUENTLY ASKED QUESTIONS (read before flagging or commenting!)

This is the official binary distribution from Microsoft. The one in the community repo is an unofficial build made from source. Beyond the license difference and branding, there are some proprietary features not available in the open source version.

Please check this page before flagging as out-of-date. If there is no new version on that page, it’s not yet released. A tag on Github is NOT a release! If you can see the new version on the updates page but the AUR package is still not updated, flag it and give it time. It’s usually done within a day or two.

The problem might be a packaging issue (wrong paths, dependencies, icons), so please write a comment here first. If you don’t get a reply, or if someone says it’s an upstream issue, you can report it on Github.

No, you won’t get a reply. Please stop doing this. Leave a comment here instead and be patient.

Latest Comments

dcelasun commented on 2022-08-10 05:58 (UTC)

phillipk commented on 2022-08-10 01:32 (UTC)

Can we take that change into this AUR package, or is there a negative side to this that i am not aware of?

PHLAK commented on 2022-07-19 04:54 (UTC) (edited on 2022-07-19 04:58 (UTC) by PHLAK)

EDIT: This looks like an issue with VS Code itself under Wayland.

SiriusBlack commented on 2022-07-12 19:58 (UTC)

I don’t understand why this is flagged out of date. I can see that it is perfectly matching to the latest version of vscode we have

Smokus commented on 2022-06-17 15:17 (UTC)

@digital wow, thanks a bunch! I tried it without sudo and it suddenly worked! Good to know!

digital commented on 2022-06-17 15:11 (UTC)

@Smokus do not run yay with sudo

Smokus commented on 2022-06-17 15:06 (UTC) (edited on 2022-06-17 15:09 (UTC) by Smokus)

:: Checking for conflicts.

:: Checking for inner conflicts.

:: (0/1) Downloaded PKGBUILD: visual-studio-code-bin

-> error fetching visual-studio-code-bin: fatal: could not create work tree dir > ‘visual-studio-code-bin’: Permission denied

context: exit status 128

Installing «code» package from official Arch Repo works just fine. Any help is appreciated.

bigbruno commented on 2022-06-09 18:53 (UTC)

i don’t know if help, but with this command is a easy way to know about last version:

dcelasun commented on 2022-05-15 14:37 (UTC)

Because it’s been more than a year since upstream enabled the sandbox on Linux and it’s time this package caught up.

koro666 commented on 2022-05-15 14:30 (UTC)

dcelasun commented on 2022-05-12 06:03 (UTC)

Added icu69 to optdepends.

bulletmark commented on 2022-05-12 01:43 (UTC)

Yes,as below, live share does not work unless icu69 package is installed. Please add it (or icu69-bin which I used?) to the dependencies.See this issue.

ambantis commented on 2022-05-11 11:34 (UTC)

After a recent upgrade, liveshare stopped working

command ‘liveshare.startFromWelcomeContent’ not found: Error: command ‘liveshare.startFromWelcomeContent’ not found

After consulting https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux, I ran the script for the required dependencies, which indicated that icu69 was missing.

After installing the icu69 AUR package (https://aur.archlinux.org/packages/icu69), live share now works.

vegancookies commented on 2022-04-20 13:52 (UTC) (edited on 2022-04-20 22:54 (UTC) by vegancookies)

I’ve installed another arch in VM to specifically test this aur package with the sign in to sync settings issue I’m facing, and it is my machine, not the package, that is at fault. I don’t know what to do to solve it but it’s working fine in VM when I sync settings. I’ve tried installing on my main machine with and without an aur helper, so some setting somewhere must be being preserved between installs. Sorry to have bothered you.

dcelasun commented on 2022-04-19 21:30 (UTC)

@phillipk: That should be fixed now, thanks!

@vegancookies: I can’t reproduce with Firefox. Could it be related to your browser somehow? I just pushed an update with a minor change to the URL handler, can you update and try again?

vegancookies commented on 2022-04-19 21:13 (UTC)

Recently I’ve been unable to sign in via github. It loads the browser for login, takes me through the 2fa process, and then the url handler goes back to vscode, where it attempts to login, but just ends up giving a notification of ‘cancelled’.

I’ve put ubuntu on a virtual machine and the program works perfectly there. I’ve tried uninstalling and reinstalling, and deleting github authentication files left over from when I was signed in. I’ve also tried to revoke vscode on github and retry from the start, but the issue persists (only the aur version).

Is there anything the user can do to re-enable this functionality or any additional information you would fine useful (everything on my system is upto date, running arch vanilla).

phillipk commented on 2022-04-14 11:07 (UTC) (edited on 2022-04-14 11:23 (UTC) by phillipk)

zensei commented on 2022-04-12 22:13 (UTC)

Are you able to add KDE wallet integration to this package?

I had to add »gnome-keyring» to be able to sync with my other copies of vs code, and it won’t stop asking me for my default keyring.

dcelasun commented on 2022-04-01 10:36 (UTC) (edited on 2022-04-01 10:36 (UTC) by dcelasun)

The Wayland issue seems to be an Electron problem [1] and should be fixed by Electron v17.3.1, which was released 2 days ago [2]. They might (or might not) include this in the upcoming recovery build [3]. In the meantime, there are workarounds mentioned in the bug report [1].

fincan commented on 2022-04-01 10:28 (UTC)

With v1.66 there are two errors:

And Code does not start. I use these flags to enable wayland support. I am on Gnome/Wayland and for better font render I use these flags:

I removed the flags and no problem but the font render is bad again :). Any solution?

abique commented on 2022-03-31 08:21 (UTC)

I confirm that 1.66 is a mess on wayland + gnome + nvidia, skip this!

vladev commented on 2022-03-31 07:50 (UTC) (edited on 2022-03-31 08:41 (UTC) by vladev)

fayez-nazzal commented on 2022-03-27 13:12 (UTC)

carlosal1015 commented on 2022-03-18 16:41 (UTC)

shore commented on 2022-03-13 00:12 (UTC)

@dcelasun kk, sorry for not seeing that. and thanks for ur replay

dcelasun commented on 2022-03-13 00:04 (UTC)

BTW, the insider version on arch seems behind the main version

shore commented on 2022-03-12 23:49 (UTC)

@dcelasun I actually did that, however the insider version works fine, so they closed the issue since it must have been fixed something. BTW, the insider version on arch seems behind the main version lol.

dcelasun commented on 2022-03-11 23:50 (UTC)

@shore it’s probably trying to connect to a Microsoft server which isn’t reachable from China, and you’re stuck until the request times out. You should report this on Github.

shore commented on 2022-03-11 23:46 (UTC)

Hi I’m in China and installed the latest package as follow:

Version: 1.65.2 Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1 Date: 2022-03-10T15:36:26.048Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.16.11-2-MANJARO

After reboot my computer, I found that each time first open vscode (meaning when open it, there is no other vscode window opened) it tooks extensive time to open it, unless I connect to the VPN (which allow me to visit google and some other webs). Also during the time it starting terminal, the extension marked is down too.

I don’t know what happened and even mopped the system and re-install everything, it still like this.

zerobot11 commented on 2022-03-04 10:14 (UTC) (edited on 2022-03-04 10:38 (UTC) by zerobot11)

No menu reveals when I click the account button to sync and login to my account.

Using version: 1.65.0 b5205cc8eb4fbaa726835538cd82372cc0222d43 x64

EDIT: Solved by installing gnome-keyring libsecret libgnome-keyring

Frontear commented on 2022-03-03 21:09 (UTC) (edited on 2022-03-03 21:49 (UTC) by Frontear)

Having an issue where my sign in doesn’t seem to persist. I’m finding that I have to constantly sign in again in order to sync my settings upon each start of the app. Any ideas?

EDIT: Now the settings sync is totally gone. Pressing account reveals no menu that would normally have «sign in with microsoft/github», and trying to sync in the settings errors with «no authentication headers».

El_Rocha commented on 2022-03-03 10:51 (UTC)

Any idea why code is complaining about there being a new update when everything is 1.64.2?

fintara commented on 2022-02-16 16:37 (UTC)

Yes, the latest update indeed broke Remote SSH (but somehow I can’t connect only to one of two identical remote machines). A fix is to put «remote.SSH.useLocalServer»: false in your settings.json for the time being.

drsensor commented on 2022-02-16 03:21 (UTC)

Somehow picom «window_type = ‘popup_menu'» doesn’t work on VSCode context menu (right-click menu that contains cut, copy, paste). Anyone know the exact WM_CLASS or WM_NAME of VSCode context menu?

francoism90 commented on 2022-02-15 07:52 (UTC)

Anyone else having issues SSH (remote) not working anymore?

It seems to happen after latest updates.

Whitie commented on 2022-02-15 07:28 (UTC)

Version 1.64.2 constantly uses 30% of CPU. Downgrading to 1.64.1 solves the issue.

FabioLolix commented on 2022-02-08 19:35 (UTC)

Hello, would you like to change the license to ‘Microsoft EULA’? Since this isn’t a paid for/freemium/commercial, just a proprietary program

dcelasun commented on 2022-02-03 15:45 (UTC)

/.config/code-flags.conf support. Thanks to @n0k0m3 for the PR!

dcelasun commented on 2022-02-02 21:36 (UTC)

@n0k0m3 It should be possible to create a wrapper that would work for both. I’ll take a look when I have some spare time. In the meantime, PRs are welcome 🙂

n0k0m3 commented on 2022-02-02 20:17 (UTC)

Maybe change the exec path to /usr/bin/code as well, or is there a reason to start with the main bin?

dcelasun commented on 2022-02-02 20:04 (UTC)

@n0k0m3 thanks, that looks like a good approach. I can add it with the next version.

n0k0m3 commented on 2022-02-02 19:33 (UTC)

Can we have launch script similar to google-chrome* AUR packages for wayland/user option parsing?

Current version of script I’m using for /usr/bin/code

dipunm commented on 2022-01-29 12:11 (UTC)

So for anyone looking for a solution in the future, you’ll likely need to modify

/.vscode/argv.json but first that PR needs to be merged and a new version needs to be released. 🙂

rpodgorny commented on 2022-01-29 11:01 (UTC)

@dipunm i can’t help you with the config but i’m just using a wrapper script which calls vscode with the parameters. an alias would work, too.

dipunm commented on 2022-01-29 00:17 (UTC)

I am trying to get vscode running in wayland mode.

However I can’t get it to run with these args as default using a flag file. I have tried the following:

(I checked the about dialog, it says it is running electrum 13)

mocambo commented on 2022-01-24 00:47 (UTC) (edited on 2022-01-24 00:54 (UTC) by mocambo)

Doesn’t work with i686

lonble commented on 2021-11-02 04:54 (UTC) (edited on 2021-11-02 04:54 (UTC) by lonble)

You should add «Provides: vscode» in the PKGBUILD, just like «code-oss» in the arch linux official repository.

francoism90 commented on 2021-10-20 08:52 (UTC)

@dcelasun @suienzan Thanks! 🙂

dcelasun commented on 2021-10-19 16:25 (UTC)

@suienzan, @francoism90: I’ve added those files, thanks for letting me know.

suienzan commented on 2021-10-19 06:44 (UTC)

jsimon0 commented on 2021-10-16 13:12 (UTC) (edited on 2021-10-16 13:28 (UTC) by jsimon0)

ETA: Resolved by completely removing and reinstalling. Leaving the rest of my comment for the next person.

After updating to 1.61.1-1, I can no longer open code on any folder. I tried moving my Code folder from

/.config to start fresh, no joy. I’ve since installed appmenu-gtk-module and no difference. Some suggestions on Stack Overflow indicate I should set DISPLAY in my shell, which didn’t make a difference. I’m running Plasma 5.22.5. code was operational on the prior package version.

Here is me opening an arbitrary folder in verbose mode. Anybody else running into this?

dcelasun commented on 2021-10-13 11:40 (UTC)

@francoism what do you mean by completion? Be specific please.

francoism90 commented on 2021-10-13 09:59 (UTC)

@dcelasun Could you please add completion as seen in the code PKG? 🙂

sunerpy commented on 2021-09-24 04:41 (UTC)

Anyone can tell me why my config is empty? 0.0

Viterzgir commented on 2021-08-21 23:34 (UTC) (edited on 2021-08-21 23:35 (UTC) by Viterzgir)

Fonts looks ugly and i cant fix it.

dcelasun commented on 2021-08-18 14:28 (UTC)

@Maverick good idea, done.

Maverick commented on 2021-08-18 13:54 (UTC)

An optional dependency «org.freedesktop.secrets» should probably be added as it is required for sync to work.

dcelasun commented on 2021-08-17 11:05 (UTC)

@SebastianWae sorry, this package follows upstream as closely as possible. If you’d like this change made, you can open an issue here.

SebastienWae commented on 2021-08-17 11:03 (UTC) (edited on 2021-08-17 11:05 (UTC) by SebastienWae)

This would be nice for wayland users and make it more consistent with other packages of vscode.

brycec commented on 2021-08-03 17:45 (UTC)

Heads up to the maintainer, I ran into https://github.com/microsoft/vscode/issues/128331 following an upgrade from 1.57.1-1 to 1.58.2-1. The issue was resolved with the chmod referenced in the release notes for the upcoming 1.59 release:

qss commented on 2021-06-09 19:24 (UTC)

armv7h version has a bug

googling «sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:CRASHING:seccomp-bpf failure in syscall 0403″ shows this bug appear in recent chromium that is compiled for 32 bit architecture. armv7h is a 32 bit arch. Visual-studio-code uses chromium as a web engine for own gui.

aoaaceai commented on 2021-05-29 07:57 (UTC)

To display the debugger fonts properly, dependency noto-fonts is required. before: Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linuxafter: Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

dcelasun commented on 2021-05-23 07:45 (UTC)

edoantonioco commented on 2021-05-23 01:09 (UTC)

It doesnt work It shows this:

==> ERROR: Cannot find the strip binary required for object file stripping.

dcelasun commented on 2021-05-14 14:36 (UTC)

@Remisa I don’t have that package installed and this package installs fine. It sounds like a problem with your AUR helper, you should report it to them.

Remisa commented on 2021-05-14 14:26 (UTC)

@dcelasun I got dependency error from yay while installing this package and after installing it manually and tried again, it worked.

dcelasun commented on 2021-05-14 13:00 (UTC)

@Remisa what is it needed for?

alumni commented on 2021-05-06 20:08 (UTC)

@dcelasun cool, thanks!

Regarding the wayland detection, probably that won’t be implemented upstream (Chromium), for Chromium & Chrome we still rely on an ArchLinux-specific hack or on bash aliases 🙂

dcelasun commented on 2021-05-06 10:15 (UTC)

@alumni thanks! I’ve pushed a fix for the WM class. As for Wayland detection, I think that’s better suited as a feature request upstream 🙂

alumni commented on 2021-05-06 08:53 (UTC) (edited on 2021-05-06 09:00 (UTC) by alumni)

antham commented on 2021-05-03 20:49 (UTC)

Several errors are thrown when starting vscode and a black window appears :

This error seems connected to this bug https://bugs.chromium.org/p/chromium/issues/detail?id=1000938, simply adding —disable-gpu when starting vscode solves the problem.

dcelasun commented on 2021-04-06 15:33 (UTC)

@crepererum done, thanks for letting me know.

crepererum commented on 2021-04-06 15:27 (UTC)

Please add xdg-utils (which provides the xdg-open binary) as an optional dependency. Otherwise, vscode cannot open browser links (e.g. when clicking on Help > Join us on twitter, when logging into github/microsoft for settings sync, when clicking on «view privacy policy», etc.).

gatmnear commented on 2021-04-02 07:35 (UTC)

@dcelasun thanks! I’m new to arch and thought pacman was a one stop shop for all; I learnt to use makepkg

dcelasun commented on 2021-04-01 07:12 (UTC) (edited on 2021-04-01 07:12 (UTC) by dcelasun)

@gatmnear: It’s a git URI, you are not meant to send an HTTP request to it. Try git clone https://aur.archlinux.org/visual-studio-code-bin.git

gatmnear commented on 2021-04-01 07:08 (UTC)

the git clone link is empty; «HTTP request sent, awaiting response. 404 Not Found»

malkovich commented on 2021-03-22 19:06 (UTC) (edited on 2021-03-23 16:20 (UTC) by malkovich)

Thanks guys for the help, found a lot of valuable advices. https://routerlogin.pro

NeedleNardleNoo commented on 2021-03-16 17:01 (UTC)

@heftig: Thank you for that point, I wasn’t aware of that hook and the install script.

@dcelasun: Thanks for adding my changes. And thank you for committing the fixes.

dcelasun commented on 2021-03-16 15:16 (UTC)

@heftig thanks, I should have reviewed it before merging. It’s fixed now.

heftig commented on 2021-03-16 14:28 (UTC) (edited on 2021-03-16 14:30 (UTC) by heftig)

So you can remove the post_install function.

dcelasun commented on 2021-03-16 13:13 (UTC)

@NeedleNardleNoo I pulled your commit in, thanks!

NeedleNardleNoo commented on 2021-03-16 12:42 (UTC) (edited on 2021-03-16 12:43 (UTC) by NeedleNardleNoo)

The deb and rpm packages currently have installation scripts that register *.code-workspace files as a mime type. I have added this functionality in the following commit on GitHub: https://github.com/conradhaupt/aur-visual-studio-code-bin/commit/61d3be3d042c206409b725f0290c03eab8785e6a

dcelasun commented on 2021-03-16 10:21 (UTC)

Sometimes the CDN has issues, try again a bit later.

AchmadFathoni commented on 2021-03-16 10:21 (UTC)

From Indonesia, what do you think?

dcelasun commented on 2021-03-15 16:29 (UTC)

It’s no bother at all! I’ve updated the package to avoid an extra redirect 🙂

pdimh commented on 2021-03-15 16:26 (UTC) (edited on 2021-03-15 16:29 (UTC) by pdimh)

@dcelasun I was debugging your package, cause i wasnt being able to download due to a network problem, and i noticed that https://vscode-update.azurewebsites.net/ was responding with http 301 and redirecting to https://update.code.visualstudio.com/. Thats why i asked. Sorry to bother you.

dcelasun commented on 2021-03-15 16:19 (UTC) (edited on 2021-03-15 16:20 (UTC) by dcelasun)

@pdimh: I wasn’t aware of that domain. I do know that vscode-update.azurewebsites.net is an official Microsoft domain for vscode. But I’ll switch it over to avoid a double redirect.

pdimh commented on 2021-03-15 16:13 (UTC)

@dcelasun i was meaning update.code.visualstudio.com, doesnt seems region-dependant. But its ok, thanks.

dcelasun commented on 2021-03-15 15:55 (UTC)

@pdimh no. These URLs are generic on purpose, the actual locations are region-dependant and might change over time.

pdimh commented on 2021-03-15 13:05 (UTC)

@dcelasun firstly, thanks for your job. binary urls in PKGBUILD return a http 301 status. Isnt it safer to change to the current url?

dcelasun commented on 2021-03-09 13:11 (UTC) (edited on 2021-03-09 13:12 (UTC) by dcelasun)

OK so it does conflict with code from community. I’ve added it back.

setpill commented on 2021-03-09 13:05 (UTC) (edited on 2021-03-09 13:05 (UTC) by setpill)

ak4nv commented on 2021-03-05 04:15 (UTC)

dcelasun commented on 2021-03-04 20:30 (UTC)

codewing commented on 2021-02-23 09:21 (UTC)

I have the same issue as DonJogi here. (for ctrl+f people like me: InitializeSandbox())

There seems to be something broken between keepassxc and vscode. I used the secret service integration but if I have it and keepassxc running then vscode crashes on startup. I fixed this by removing the vscode sync entry in keepassxc and then it worked again even after syncing it again. Weird.

kaiserbh commented on 2021-02-17 22:32 (UTC) (edited on 2021-02-17 22:32 (UTC) by kaiserbh)

thanks the one one in the community repo has a signing issue, it just stuck on loading for me, but this version seem to have fixed that and managed to sync my settings.

tomatopeel commented on 2021-02-17 16:41 (UTC)

I want to install an older version because the new version is performing worse for me, so I need to test if that is the problem.

When I try to install any older major version, I get e.g.:

How can I install an older version? Cheers

Nehu commented on 2021-02-13 19:28 (UTC) (edited on 2021-03-13 23:00 (UTC) by Nehu)

Would it be possible to not mark this package as conflicting with code?

As far as I’m aware, the OSS version and this one do not share the same config folder (

Removing the «conflicts» statement would allow a parallel installation of both, which in turn is useful for using this binary release for C# development (in a properly secured environment) and the OSS release (in a more flexible environment) for everything else.

neo2001 commented on 2021-02-12 11:42 (UTC) (edited on 2021-02-12 11:42 (UTC) by neo2001)

No crashes here either.

dcelasun commented on 2021-02-12 11:27 (UTC)

@cusidawgs it’s not crashing for me. Perhaps you should report it upstream?

cusidawgs commented on 2021-02-12 11:25 (UTC)

Is it just me or the new version crashes on my installation. Followed all steps on the pinned comment and deleted every vscode configuration folder, yet the problem still persists

mcmar commented on 2021-02-11 22:54 (UTC)

Thank you @bulletmark. I’m not using yay, but the package cache was the issue.

dcelasun commented on 2021-02-11 21:01 (UTC)

Also refer to the stickied FAQ please, particularly the third bullet point.

bulletmark commented on 2021-02-11 21:00 (UTC)

/.cache/yay/visual-studio-code-bin then run yay again.

dcelasun commented on 2021-02-11 20:58 (UTC)

@mcmar I’ve pushed a new release with updated checksums. Did you try installing 1.53.1-2?

mcmar commented on 2021-02-11 20:54 (UTC)

@dcelasun I don’t understand. You said it «should be fine now» and then said «read the comment below». I read all the comments and it’s not fine. The package update still fails. What’s the fix?

Code editing. Redefined.

Free. Built on open source. Runs everywhere.

By using VS Code, you agree to its license and privacy statement.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Meet IntelliSense.

Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Print statement debugging is a thing of the past.

Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Git commands built-in.

Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Extensible and customizable.

Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won’t slow down your editor. Learn more about extensions.

Visual studio code linux. Смотреть фото Visual studio code linux. Смотреть картинку Visual studio code linux. Картинка про Visual studio code linux. Фото Visual studio code linux

Deploy with confidence and ease

With Microsoft Azure you can deploy and host your React, Angular, Vue, Node, Python (and more!) sites, store and query relational and document based data, and scale with serverless computing, all with ease, all from within VS Code.

VS Code for

Want new features sooner?

Use vscode.dev for quick edits online!

GitHub, Azure Repos, and local files.

License and Privacy Terms

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement. VS Code automatically sends telemetry data and crash dumps to help us improve the product. If you would prefer not to have this data sent please go see How to Disable Crash Reporting to learn how to disable it.

Источники:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *