3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Windows版Visual Studio CodeとWSLの連携手順について

Last updated at Posted at 2020-05-14

概要

  • Windows版のVSCodeでWSLをシームレスに連携する手順の記事です
  • もはやmacOSと差がなさそう、Windowsでもストレスフリーに開発出来る

はじめに

プログラミングと言えばmacOSだと思っていましたが、どうやら最近は違うようで、WSLというのが誕生しWindowsでもLinuxシェルが使えると。
具体的にmacOSがプログラミング向きである理由は正直よくわからんというところですが、確かに同じシェルが使えれば開発環境として問題なさそうです。
VSCodeと組み合わせられればもうWindowsだけでよくなっちゃうな、ということで試した手順をまとめました。

前提

  • Pythonスクリプトをよく書きます、あとフロントでVueを書いたりします、そんなエンジニア目線の記事です
  • 他所で紹介されている手順だと、ストアのものとはと別のWSLと連携していたりしますが、本手順なら、ストアのものと同一のWSLをVSCodeでシームレスに使えるようになります

VSCodeとWSL連携

  • アプリストアでubuntuをダウンロード・インストール
  • VSCodeの左下の歯車からSettingsを開き Terminal › Integrated › Automation Shell: Windows などから開けるsettings.jsonに以下の行を追加し保存する

"terminal.integrated.shellArgs.windows": ["wsl"],
こちらは非推奨になりました

"terminal.integrated.defaultProfile.windows": "Ubuntu-18.04 (WSL)",

インストールしているubuntuのバージョンによって記述が変化するはず(不正な入力ならGUIで注釈が出ます)

おわりに

以上の手順で、VSCodeのシェルを起動すると自動的にWSLが立ち上がるようになりました。カレントディレクトリもよしなに初期設定してくれます。これが実現したので、もはや開発環境においてmacOSの優位性というのはあるのかどうなのか。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?