差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
windows:windows_terminal [2020/03/09 06:52] – ともやん | windows:windows_terminal [2023/07/21 06:57] – [settings.json の設定例] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | < | ||
- | #setting pre { | ||
- | overflow: scroll; | ||
- | overflow-x: hidden; | ||
- | font-size: 12px; | ||
- | } | ||
- | # | ||
- | height: 300px; | ||
- | overflow: scroll; | ||
- | overflow-x: hidden; | ||
- | font-size: 12px; | ||
- | } | ||
- | </ | ||
- | </ | ||
====== Windows Terminal ====== | ====== Windows Terminal ====== | ||
Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\ | Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\ | ||
- | 2020/03/09 現在のバージョンは **Windows Terminal | + | 2020/05/14 現在のバージョンは **Windows Terminal Version: 0.11.1333.0 (1.0RC2)** である。\\ |
[[https:// | [[https:// | ||
\\ | \\ | ||
行 22: | 行 7: | ||
ソースコード: | ソースコード: | ||
\\ | \\ | ||
- | {{:windows: | + | {{windows: |
+ | ===== システム必要条件 ===== | ||
+ | Windows Terminal requires Windows 10 1903 (build 18362) 以降\\ | ||
+ | [[windows: | ||
+ | <code powershell> | ||
+ | $ cmd /c ver | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | <code powershell> | ||
+ | Microsoft Windows [Version 10.0.18363.836] | ||
+ | </ | ||
+ | </ | ||
+ | OS バージョンを更新しないとインストールできないようである。\\ | ||
+ | {{windows: | ||
+ | |||
+ | ===== インストール ===== | ||
+ | [[windows: | ||
+ | <code powershell> | ||
+ | $ scoop bucket add dorado https:// | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | Checking repo... ok | ||
+ | The dorado bucket was added successfully. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP prewrap 100%> | ||
+ | <code powershell> | ||
+ | $ sudo scoop install windowsterminal-np --global | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | < | ||
+ | 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:// | ||
===== コピー & ペースト ===== | ===== コピー & ペースト ===== | ||
< | < | ||
行 34: | 行 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. | ||
- | ==== 設定例 ==== | ||
- | <WRAP prewrap 100% # | ||
- | <file javascript profile.json> | ||
// To view the default settings, hold " | // To view the default settings, hold " | ||
// For documentation on these settings, see: https:// | // For documentation on these settings, see: https:// | ||
- | |||
{ | { | ||
" | " | ||
+ | | ||
" | " | ||
- | + | | |
- | "globals" : | + | "initialCols": |
- | | + | |
- | "initialCols" : 120, | + | |
- | "initialRows" : 35 | + | // 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:// | ||
" | " | ||
{ | { | ||
行 57: | 行 121: | ||
{ | { | ||
// Put settings here that you want to apply to all profiles | // Put settings here that you want to apply to all profiles | ||
- | " | ||
- | " | ||
" | " | ||
- | " | + | " |
" | " | ||
- | " | + | " |
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
//" | //" | ||
//" | //" | ||
行 73: | 行 144: | ||
" | " | ||
[ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | //" | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
// Make changes here to the powershell.exe profile | // Make changes here to the powershell.exe profile | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
- | "hidden": | + | "startingDirectory" : " |
}, | }, | ||
{ | { | ||
// Make changes here to the cmd.exe profile | // Make changes here to the cmd.exe profile | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
" | " | ||
- | "colorScheme": "One Half Dark" | + | "name": "FedoraRemix", |
+ | " | ||
}, | }, | ||
{ | { | ||
- | " | + | " |
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | |
}, | }, | ||
{ | { | ||
- | " | + | " |
" | " | ||
- | " | + | " |
" | " | ||
}, | }, | ||
行 110: | 行 198: | ||
}, | }, | ||
- | // Add custom color schemes to this array | + | // Add custom color schemes to this array. |
- | " | + | // To learn more about color schemes, visit https:// |
+ | " | ||
+ | | ||
+ | { | ||
+ | " | ||
- | // Add any keybinding overrides | + | " |
- | // To unbind a default keybinding, set the command to " | + | " |
- | " | + | |
+ | " | ||
+ | " | ||
+ | |||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | | ||
+ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ], | ||
+ | |||
+ | | ||
+ | // To unbind a key combination from your defaults.json, set the command to " | ||
+ | // 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 画像を使用。\\ | ※**backgroundImage** は 400 x 300px の png 画像を使用。\\ | ||
+ | |||
+ | ==== WSL の レジストリ設定を一覧表示する ==== | ||
+ | **Get-ChildItem** コマンドレットでレジストリを調べる。\\ | ||
+ | <WRAP prewrap 100%> | ||
+ | <code powershell> | ||
+ | $ Get-ChildItem -Path HKCU: | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP prewrap 100% #result> | ||
+ | <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 を追加する ==== | ||
行 131: | 行 570: | ||
</ | </ | ||
生成した **GUID** を使用して **profiles** を以下の様にすると **MSYS2 MinGW 64-bit** が上手く**タブ**になる。\\ | 生成した **GUID** を使用して **profiles** を以下の様にすると **MSYS2 MinGW 64-bit** が上手く**タブ**になる。\\ | ||
- | <WRAP prewrap 100% #setting> | + | <WRAP prewrap 100% #mincode> |
<file javascript profile.json> | <file javascript profile.json> | ||
{ | { | ||
行 164: | 行 603: | ||
=== 失敗例 === | === 失敗例 === | ||
生成した **GUID** を使用して **profiles** を以下の様に追加してみたが、**MSYS2 MinGW 64-bit** は起動できるものの**タブ**にはならなかった。(別窓になってしまう)\\ | 生成した **GUID** を使用して **profiles** を以下の様に追加してみたが、**MSYS2 MinGW 64-bit** は起動できるものの**タブ**にはならなかった。(別窓になってしまう)\\ | ||
- | <WRAP prewrap 100% #setting> | + | <WRAP prewrap 100% #mincode> |
<file javascript profile.json> | <file javascript profile.json> | ||
{ | { | ||
行 191: | 行 630: | ||
</ | </ | ||
- | ==== デフォルトで起動するターミナルを **PowerShell** から **コマンドプロンプト(cmd)** に変更する場合 | + | デフォルトで起動するターミナルを **PowerShell** から **コマンドプロンプト(cmd)** に変更する場合\\ |
**defaultProfile** に **profiles** の **guid** を設定すると変更できる。\\ | **defaultProfile** に **profiles** の **guid** を設定すると変更できる。\\ | ||
- | <WRAP prewrap 100% #setting> | + | <WRAP prewrap 100% #mincode> |
<code javascript> | <code javascript> | ||
" | " | ||
行 216: | 行 655: | ||
**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% #setting> | + | <WRAP prewrap 100% #mincode> |
<file javascript profile.json> | <file javascript profile.json> | ||
{ | { | ||
行 235: | 行 674: | ||
}, | }, | ||
</ | </ | ||
+ | </ | ||
+ | |||
+ | ===== トラブルシューティング ===== | ||
+ | |||
+ | ==== 長時間実行プロセスを 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:// | ||
+ | [[https:// | ||
+ | \\ | ||
+ | [[https:// | ||