About the procedure for linking Visual Studio Code for Windows and WSL

Overview

--This is an article on the procedure for seamlessly linking WSL with VS Code for Windows. ――It seems that there is no difference with macOS anymore, you can develop stress-free even on Windows

Introduction

Speaking of programming, I thought that it was macOS, but it seems that it is different these days, and WSL was born and the Linux shell can be used on Windows. To be honest, I'm not sure why macOS is suitable for programming, but it seems that there is no problem as a development environment if the same shell can be used. I summarized the procedure I tried because if it is combined with VS Code, it will be better only with Windows.

Premise

--I often write Python scripts, and I also write Vue at the front desk, which is an article from an engineer's perspective. --If the procedure is introduced elsewhere, it may be linked with a WSL different from the one in the store, but with this procedure, you will be able to use the same WSL as the one in the store seamlessly with VS Code.

Install VS Code

VS Code and WSL integration

--Download and install ubuntu from the app store --Open Settings from the lower left gear of VS Code Terminal ›Integrated ›Automation Shell: Open from Windows Add and save the following line to settings.json

"terminal.integrated.shellArgs.windows": ["wsl"],

--This line means the command to be executed automatically when the default shell is started. --In other words, the command "wsl" is executed in Powershell. --Therefore, WSL will be started automatically when VS Code shell is started.

Various methods are introduced in various places, but I think that the above method is the simplest because the WSL used in VS Code is different from the one in the store and it is complicated.

in conclusion

With the above procedure, WSL will start automatically when you start the VS Code shell. The current directory is also nicely initialized. Now that this has happened, I wonder if there is any advantage of macOS in the development environment ... It's essential if you want to develop iOS, but if not ... Yeah.

Recommended Posts

About the procedure for linking Visual Studio Code for Windows and WSL
Enable the virtualenv Python virtual environment for Visual Studio Code
Install python and Visual Studio Code on windows10 (April 2020 version)
Installation of Visual studio code and installation of python
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Settings for Python coding in Visual Studio Code
[Visual Studio Code] [Python] Tasks.json + problemMatcher settings for Python
Execute C ++ functions from Python with Pybind11 (for Windows & Visual Studio Code people) Debugging
Make Visual Studio Code autocomplete for python external libraries
Python development environment with Windows + Anaconda3 + Visual Studio Code
Python development environment with Windows + Python + PipEnv + Visual Studio Code
Problems and solutions for using the remote debugging environment for Linux apps in Visual Studio 2017
Execute C ++ functions from Python with Pybind11 (for Windows & Visual Studio Code people) Environment construction
[Visual Studio Code] [Python] [Windows] Support for garbled Japanese characters in Python in VS Code task / debug output
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
Comfortable LaTeX with Windows Subsystem for Linux and VS Code
About the need for the first slash in the subscriber name and publisher name
Try to create a python environment with Visual Studio Code & WSL
Until Windows Subsystem for Linux (WSL) is installed in Windows and fish is installed
Goodbye to the command prompt in WSL, VSCode and Windows Terminal
Build an environment to execute C ++ functions from Python with Pybind11 (for Windows & Visual Studio Code people)
Reasons and work notes for the tool / environment kitchen to switch the main PC from Linux to Windows + WSL2
Java with Visual Studio Code (Part 2)
Visual Studio Code may be good
Use Jupyter Notebook with Visual Studio Code on Windows 10 + Python + Poetry + pyenv-win
I installed the library with Visual Studio Code, but Unable to import
Impressions and memorandums when working with VS code for the first time