Windows Terminal:起動時のプロファイルをWSL2に変更する方法

スポンサーリンク

起動時のプロファイルをWSL2に変更する方法

起動時のプロファイルを変更するにはWindows Terminalの設定からsettings.jsonを開きます(またはCtrl+,キーで開く)。

 

最初に"profiles"以下のプロファイルリストからWSL2のディストリビューションの"guid"を確認します。

            {
                "guid": "{07b52e3e-38b7-51cf-bd2d-afceeeaa6101}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            }

 

そして、"defaultProfile"に確認したguidをセットします。

設定例

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{07b52e3e-38b7-51cf-bd2d-afceeeaa6101}",