Windows Terminal でubuntu(WSL)を利用できるようにする

Windows Terminal でubuntu(WSL)を利用できるようにする

windows10にubuntuをインストールしたので、windows Terminalからコマンドが打てるようにubuntuを追加する

guidの確認

レジストリエディタを起動

HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss に移動 し、guidを確認する

赤枠部にguidがあります

アイコンファイル確認

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.4.2382.0_x64__8wekyb3d8bbwe\ProfileIcons の中にある画像を使用する

※アクセス権を変更しないとアクセスできない

TrustedInstallerから現在のユーザーに変更するとアクセス可能となる

profiles.json 編集

Windows Terminal>Settings よりprofiles.jsonを開く

profilesを編集する

##  "profiles" : に下記を追加する


 "profiles" : 
    [
        {
       "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu",
            "cursorColor" : "#DDDDDD",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 14,
            "guid" : "{さきほど確認したguidを入力}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/アイコンファイル名",
            "name" : "Ubuntu",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "%USERPROFILE%",
            "useAcrylic" : true        
         },

以上で利用可能になる