--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
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.
--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.
--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.
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.