差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| windows:windows_terminal [2019/08/19 07:26] – ともやん | windows:windows_terminal [2023/09/20 18:15] (現在) – [settings.json の設定例] ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | < | ||
| - | < | ||
| - | #result pre { | ||
| - | height: 200px; | ||
| - | overflow: scroll; | ||
| - | overflow-x: hidden; | ||
| - | } | ||
| - | </ | ||
| - | </ | ||
| ====== Windows Terminal ====== | ====== Windows Terminal ====== | ||
| Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\ | Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\ | ||
| - | 2019/08/13 現在のバージョンは **Windows Terminal | + | 2020/05/14 現在のバージョンは **Windows Terminal Version: 0.11.1333.0 (1.0RC2)** である。\\ |
| [[https:// | [[https:// | ||
| \\ | \\ | ||
| 行 16: | 行 7: | ||
| ソースコード: | ソースコード: | ||
| \\ | \\ | ||
| - | {{:windows: | + | {{windows: |
| + | |||
| + | ===== システム必要条件 ===== | ||
| + | Windows Terminal requires Windows 10 1903 (build 18362) 以降\\ | ||
| + | [[windows: | ||
| + | <code powershell> | ||
| + | $ cmd /c ver | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | <code powershell> | ||
| + | Microsoft Windows [Version 10.0.18363.836] | ||
| + | </ | ||
| + | </ | ||
| + | OS バージョンを更新しないとインストールできないようである。\\ | ||
| + | {{windows: | ||
| + | |||
| + | ===== インストール ===== | ||
| + | [[windows: | ||
| + | <code powershell> | ||
| + | $ scoop bucket add dorado https:// | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | < | ||
| + | Checking repo... ok | ||
| + | The dorado bucket was added successfully. | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ sudo scoop install windowsterminal-np --global | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | < | ||
| + | Installing ' | ||
| + | Microsoft.WindowsTerminal_0.11.1333.0_8wekyb3d8bbwe.msixbundle (18.2 MB) [====================================] 100% | ||
| + | Checking hash of Microsoft.WindowsTerminal_0.11.1333.0_8wekyb3d8bbwe.msixbundle ... ok. | ||
| + | Running installer script... | ||
| + | Linking C: | ||
| + | ' | ||
| + | </ | ||
| + | </ | ||
| + | **Microsoft Store** よりインストールする場合\\ | ||
| + | [[https:// | ||
| ===== コピー & ペースト ===== | ===== コピー & ペースト ===== | ||
| < | < | ||
| 行 28: | 行 63: | ||
| ===== 設定 ===== | ===== 設定 ===== | ||
| Windows Terminal の設定はタブのドロップダウンから **Settings** を選択して **json ファイル**を編集する。\\ | Windows Terminal の設定はタブのドロップダウンから **Settings** を選択して **json ファイル**を編集する。\\ | ||
| - | {{:windows: | + | <WRAP prewrap 100%> |
| + | ファイルパス: | ||
| + | </ | ||
| + | </ | ||
| + | {{windows: | ||
| + | |||
| + | ==== settings.json のセクション構成 ==== | ||
| + | <WRAP prewrap 100% # | ||
| + | ^ セクション | ||
| + | | グローバル設定\\ (Global Settings - start) | ||
| + | | +- プロファイル\\ (Profiles) | ||
| + | { | ||
| + | ... | ||
| + | },</ | ||
| + | | +- 配色\\ (Color Schemes) | ||
| + | | +- キーバインド\\ (Key Bindings) | ||
| + | [ | ||
| + | ... | ||
| + | ]</ | ||
| + | | グローバル設定\\ (Global Settings - end) | <code javascript> | ||
| + | </ | ||
| + | |||
| + | ==== settings.json の設定例 ==== | ||
| + | <WRAP prewrap 100% # | ||
| + | <file javascript settings.json> | ||
| + | // This file was initially generated by Windows Terminal 0.11.1251.0 | ||
| + | // It should still be usable in newer versions, but newer versions might have additional | ||
| + | // settings, help text, or changes that you will not see unless you clear this file | ||
| + | // and let us generate a new one for you. | ||
| + | |||
| + | // To view the default settings, hold " | ||
| + | // For documentation on these settings, see: https:// | ||
| + | { | ||
| + | " | ||
| + | |||
| + | " | ||
| + | |||
| + | " | ||
| + | " | ||
| + | |||
| + | // You can add more global application settings here. | ||
| + | // To learn more about global settings, visit https:// | ||
| + | |||
| + | // If enabled, selections are automatically copied to your clipboard. | ||
| + | " | ||
| + | |||
| + | // If enabled, formatted data is also copied to your clipboard | ||
| + | " | ||
| + | |||
| + | // A profile specifies a command to execute paired with information about how it should look and feel. | ||
| + | // Each one of them will appear in the 'New Tab' dropdown, | ||
| + | // and can be invoked from the commandline with `wt.exe -p xxx` | ||
| + | // To learn more about profiles, visit https:// | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | // Put settings here that you want to apply to all profiles | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | |||
| + | //" | ||
| + | //" | ||
| + | //" | ||
| + | //" | ||
| + | //" | ||
| + | //" | ||
| + | //" | ||
| + | }, | ||
| + | " | ||
| + | [ | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | //" | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | // Make changes here to the powershell.exe profile | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | // Make changes here to the cmd.exe profile | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | }, | ||
| + | |||
| + | // Add custom color schemes to this array. | ||
| + | // To learn more about color schemes, visit https:// | ||
| + | " | ||
| + | [ | ||
| + | { | ||
| + | " | ||
| + | |||
| + | " | ||
| + | " | ||
| + | |||
| + | " | ||
| + | " | ||
| + | |||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | [ | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ], | ||
| + | |||
| + | // Add custom keybindings to this array. | ||
| + | // To unbind a key combination from your defaults.json, | ||
| + | // To learn more about keybindings, | ||
| + | " | ||
| + | [ | ||
| + | // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. | ||
| + | // These two lines additionally bind them to Ctrl+C and Ctrl+V. | ||
| + | // To learn more about selection, visit https:// | ||
| + | { " | ||
| + | { " | ||
| + | |||
| + | // Press Ctrl+Shift+F to open the search box | ||
| + | { " | ||
| + | |||
| + | // Press Alt+Shift+D to open a new pane. | ||
| + | // - " | ||
| + | // - " | ||
| + | // To learn more about panes, visit https:// | ||
| + | { " | ||
| + | ] | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | ※**backgroundImage** は 400 x 300px の png 画像を使用。\\ | ||
| + | |||
| + | ==== WSL の レジストリ設定を一覧表示する ==== | ||
| + | **Get-ChildItem** コマンドレットでレジストリを調べる。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ Get-ChildItem -Path HKCU: | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | <code powershell> | ||
| + | |||
| + | Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss | ||
| + | |||
| + | Name | ||
| + | ---- | ||
| + | {874A2A70-6EAF-42C1-A6F6-1C2EA DistributionName | ||
| + | C2BFA52} | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | {CC54D096-DBCD-4D93-93A5-899AE DistributionName | ||
| + | 35559B4} | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | {E74B61AB-F675-4518-A0E3-BCEE9 DistributionName | ||
| + | C7F8E9C} | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | {F9260EF7-5866-4DAC-8E4F-86487 DistributionName | ||
| + | 1004DA4} | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| ==== MSYS2 MinGW 64-bit を追加する ==== | ==== MSYS2 MinGW 64-bit を追加する ==== | ||
| 行 40: | 行 571: | ||
| </ | </ | ||
| 生成した **GUID** を使用して **profiles** を以下の様にすると **MSYS2 MinGW 64-bit** が上手く**タブ**になる。\\ | 生成した **GUID** を使用して **profiles** を以下の様にすると **MSYS2 MinGW 64-bit** が上手く**タブ**になる。\\ | ||
| + | <WRAP prewrap 100% # | ||
| <file javascript profile.json> | <file javascript profile.json> | ||
| { | { | ||
| 行 64: | 行 596: | ||
| }, | }, | ||
| </ | </ | ||
| + | </ | ||
| {{: | {{: | ||
| 行 71: | 行 604: | ||
| === 失敗例 === | === 失敗例 === | ||
| 生成した **GUID** を使用して **profiles** を以下の様に追加してみたが、**MSYS2 MinGW 64-bit** は起動できるものの**タブ**にはならなかった。(別窓になってしまう)\\ | 生成した **GUID** を使用して **profiles** を以下の様に追加してみたが、**MSYS2 MinGW 64-bit** は起動できるものの**タブ**にはならなかった。(別窓になってしまう)\\ | ||
| + | <WRAP prewrap 100% # | ||
| <file javascript profile.json> | <file javascript profile.json> | ||
| { | { | ||
| 行 95: | 行 629: | ||
| }, | }, | ||
| </ | </ | ||
| + | </ | ||
| - | ==== デフォルトで起動するターミナルを **PowerShell** から **コマンドプロンプト(cmd)** に変更する | + | デフォルトで起動するターミナルを **PowerShell** から **コマンドプロンプト(cmd)** に変更する場合\\ |
| **defaultProfile** に **profiles** の **guid** を設定すると変更できる。\\ | **defaultProfile** に **profiles** の **guid** を設定すると変更できる。\\ | ||
| + | <WRAP prewrap 100% # | ||
| <code javascript> | <code javascript> | ||
| " | " | ||
| 行 117: | 行 653: | ||
| ], | ], | ||
| </ | </ | ||
| + | </ | ||
| + | |||
| **defaultProfile** を **{61c54bbd-c2c6-5271-96e7-009a87ff44bf}**(Windows PowerShell) から **{0caa0dad-35be-5f56-a8ff-afceeeaa6101}**(cmd) に変更する。\\ | **defaultProfile** を **{61c54bbd-c2c6-5271-96e7-009a87ff44bf}**(Windows PowerShell) から **{0caa0dad-35be-5f56-a8ff-afceeeaa6101}**(cmd) に変更する。\\ | ||
| + | <WRAP prewrap 100% # | ||
| <file javascript profile.json> | <file javascript profile.json> | ||
| { | { | ||
| 行 136: | 行 675: | ||
| }, | }, | ||
| </ | </ | ||
| + | </ | ||
| + | ===== トラブルシューティング ===== | ||
| + | |||
| + | ==== 長時間実行プロセスを Ctrl + C で終了すると PowerShell が終了する ==== | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | PowerShell 7.0.2 | ||
| + | Copyright (c) Microsoft Corporation. All rights reserved. | ||
| + | |||
| + | https:// | ||
| + | Type ' | ||
| + | |||
| + | PS C: | ||
| + | PS D:\wsl> xz .\fedora.tar | ||
| + | |||
| + | [プロセスはコード 3221225786 で終了しました] | ||
| + | </ | ||
| + | </ | ||
| + | 英語では以下のようにシェルが終了する。\\ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | [process exited with code 3221225786] | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | 設定 (settings.json) の **" | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code javascript settings.json> | ||
| + | " | ||
| + | [ | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | //" | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ==== バージョンアップ後にユーザー設定読み込みエラーが発生する ==== | ||
| + | バージョンアップ後に以下のエラーが発生する。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | < | ||
| + | ユーザー設定の読み込み中にエラーが発生しました | ||
| + | The " | ||
| + | </ | ||
| + | </ | ||
| + | [[https:// | ||
| + | <WRAP prewrap 100%> | ||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | </ | ||
| + | {{windows: | ||
| + | |||
| + | 以下のような " | ||
| + | <WRAP prewrap 100% # | ||
| + | <code javascript profile.json> | ||
| + | { | ||
| + | " | ||
| + | | ||
| + | " | ||
| + | | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | ... | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | " | ||
| + | <WRAP prewrap 100% # | ||
| + | <code javascript profile.json> | ||
| + | { | ||
| + | " | ||
| + | | ||
| + | " | ||
| + | | ||
| + | " | ||
| + | " | ||
| + | | ||
| + | " | ||
| + | { | ||
| + | ... | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== 参考文献 ===== | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | \\ | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | \\ | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | \\ | ||
| + | [[https:// | ||