windows:windows_terminal

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
windows:windows_terminal [2020/05/28 06:07] – [json のセクション構成] ともやんwindows:windows_terminal [2020/09/19 10:22] – [設定] ともやん
行 1: 行 1:
-<html> 
-  <style> 
-    #result pre, #mincode pre { 
-      overflow: hidden; 
-      font-size: 10px; 
-    } 
-    #result_long pre { 
-      height: 250px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #mintbl table { 
-      font-size: 12px; 
-    } 
-    #mintbl td pre { 
-      margin: 0; 
-    } 
-    .dokuwiki .plugin_wrap table { 
-      width: auto; 
-    } 
-    #logo { 
-      background-color: white; 
-      padding: 10px; 
-      width: fit-content; 
-    } 
-    #logo p { 
-      margin: 0; 
-    } 
-  </style> 
-</html> 
 ====== Windows Terminal ====== ====== Windows Terminal ======
 Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\ Windows Terminal は Windows 10 向けの新しいコマンドプロンプトを提供する。Linux ターミナルのようにマルチタブなどの機能も提供されている。\\
行 38: 行 7:
 ソースコード: [[https://github.com/microsoft/terminal|GitHub - microsoft/terminal: The new Windows Terminal, and the original Windows console host -- all in the same place!]]\\ ソースコード: [[https://github.com/microsoft/terminal|GitHub - microsoft/terminal: The new Windows Terminal, and the original Windows console host -- all in the same place!]]\\
 \\ \\
-{{:windows:windows_terminal.png?470|Windows Terminal}}\\+{{windows:windows_terminal.png?470|Windows Terminal}}\\
  
 ===== システム必要条件 ===== ===== システム必要条件 =====
行 52: 行 21:
 </WRAP> </WRAP>
 OS バージョンを更新しないとインストールできないようである。\\ OS バージョンを更新しないとインストールできないようである。\\
-{{:windows:windows_terminal_os_spec.png?800|Microsofe Store}}\\+{{windows:windows_terminal_os_spec.png?800|Microsofe Store}}\\
  
 ===== インストール ===== ===== インストール =====
行 94: 行 63:
 ===== 設定 ===== ===== 設定 =====
 Windows Terminal の設定はタブのドロップダウンから **Settings** を選択して **json ファイル**を編集する。\\ Windows Terminal の設定はタブのドロップダウンから **Settings** を選択して **json ファイル**を編集する。\\
-{{:windows:windows_terminal_settings.png?284|Windows Terminal Settings}}\\+<WRAP prewrap 100%> 
 +ファイルパス: <html><code>%USERPROFILE%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json</code> 
 +</html> 
 +</WRAP> 
 +{{windows:windows_terminal_settings.png?284|Windows Terminal Settings}}\\
  
 ==== settings.json のセクション構成 ==== ==== settings.json のセクション構成 ====
行 104: 行 77:
     ...     ...
     },</code>  |     },</code>  |
-| +- Color Schemes  | <code javascript>    "schemes": [],</code> +| +- 配色\\ (Color Schemes | <code javascript>    "schemes": [],</code> 
-| +- Key Bindings  | <code javascript>    "keybindings":+| +- キーバインド\\ (Key Bindings | <code javascript>    "keybindings":
     [     [
     ...     ...
行 129: 行 102:
     "initialCols": 120,     "initialCols": 120,
     "initialRows": 35,     "initialRows": 35,
 +    
     // You can add more global application settings here.     // You can add more global application settings here.
     // To learn more about global settings, visit https://aka.ms/terminal-global-settings     // To learn more about global settings, visit https://aka.ms/terminal-global-settings
 +    
     // If enabled, selections are automatically copied to your clipboard.     // If enabled, selections are automatically copied to your clipboard.
     "copyOnSelect": false,     "copyOnSelect": false,
 +    
     // If enabled, formatted data is also copied to your clipboard     // If enabled, formatted data is also copied to your clipboard
     "copyFormatting": false,     "copyFormatting": false,
 +    
     // A profile specifies a command to execute paired with information about how it should look and feel.     // 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,     // Each one of them will appear in the 'New Tab' dropdown,
行 149: 行 122:
             // Put settings here that you want to apply to all profiles             // Put settings here that you want to apply to all profiles
             "fontFace": "HackGen35 Console",             "fontFace": "HackGen35 Console",
-            "fontSize"10,+            "fontSize"9,
             "backgroundImage": "C:\\Users\\tomoyan\\Pictures\\mg_chara.png",             "backgroundImage": "C:\\Users\\tomoyan\\Pictures\\mg_chara.png",
             "backgroundImageStretchMode": "none",             "backgroundImageStretchMode": "none",
             "backgroundImageAlignment": "bottomRight",             "backgroundImageAlignment": "bottomRight",
             "backgroundImageOpacity": 0.5             "backgroundImageOpacity": 0.5
 +            
             //"colorScheme": "Campbell"             //"colorScheme": "Campbell"
             //"colorScheme": "Campbell Powershell"             //"colorScheme": "Campbell Powershell"
行 164: 行 138:
         "list":         "list":
         [         [
 +            {
 +                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
 +                "hidden": false,
 +                "name": "PowerShell Core",
 +                //"source": "Windows.Terminal.PowershellCore",
 +                "commandline": "%USERPROFILE%\\scoop\\apps\\powershell\\current\\pwsh.exe",
 +                "icon": "%USERPROFILE%\\scoop\\apps\\powershell\\current\\assets\\Powershell_av_colors.ico",
 +                "colorScheme": "Campbell",
 +                "startingDirectory" : "%USERPROFILE%"
 +            },
             {             {
                 // Make changes here to the powershell.exe profile                 // Make changes here to the powershell.exe profile
                 "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",                 "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
 +                "hidden": false,
                 "name": "Windows PowerShell",                 "name": "Windows PowerShell",
                 "commandline": "powershell.exe",                 "commandline": "powershell.exe",
-                "hidden": false+                "startingDirectory" : "%USERPROFILE%"
             },             },
             {             {
                 // Make changes here to the cmd.exe profile                 // Make changes here to the cmd.exe profile
                 "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",                 "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
 +                "hidden": false,
                 "name": "コマンドプロンプト",                 "name": "コマンドプロンプト",
                 "commandline": "cmd.exe",                 "commandline": "cmd.exe",
-                "hidden": false, +                "colorScheme": "One Half Dark", 
-                "colorScheme": "One Half Dark" +                "startingDirectory" : "%USERPROFILE%"
-            }, +
-            { +
-                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", +
-                "hidden": false, +
-                "name": "PowerShell Core", +
-                "source": "Windows.Terminal.PowershellCore", +
-                "colorScheme": "Campbell"+
             },             },
             {             {
行 191: 行 170:
                 "name": "FedoraRemix",                 "name": "FedoraRemix",
                 "source": "Windows.Terminal.Wsl"                 "source": "Windows.Terminal.Wsl"
-            }, 
-            { 
-                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", 
-                "hidden": false, 
-                "name": "Azure Cloud Shell", 
-                "source": "Windows.Terminal.Azure" 
             },             },
             {             {
行 209: 行 182:
                 "name": "Fedora-WSL1",                 "name": "Fedora-WSL1",
                 "source": "Windows.Terminal.Wsl"                 "source": "Windows.Terminal.Wsl"
 +            },
 +            {
 +                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
 +                "hidden": false,
 +                "name": "Azure Cloud Shell",
 +                "source": "Windows.Terminal.Azure"
             }             }
         ]         ]
行 241: 行 220:
 </WRAP> </WRAP>
 ※**backgroundImage** は 400 x 300px の png 画像を使用。\\ ※**backgroundImage** は 400 x 300px の png 画像を使用。\\
 +
 +==== WSL の レジストリ設定を一覧表示する ====
 +**Get-ChildItem** コマンドレットでレジストリを調べる。\\
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +
 +    Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
 +
 +Name                           Property
 +----                           --------
 +{874A2A70-6EAF-42C1-A6F6-1C2EA DistributionName   : FedoraRemix
 +C2BFA52}                       BasePath           : C:\wsl\FedoraRemix
 +                               State              : 1
 +                               Version            : 2
 +                               DefaultEnvironment : {HOSTTYPE=x86_64, LANG=en_US.UTF-8, PATH=/usr/local/sbin:/usr/loc
 +                               al/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, TERM=xterm-256color}
 +                               DefaultUid         : 1000
 +                               KernelCommandLine  : BOOT_IMAGE=/kernel init=/init ro
 +                               Flags              : 15
 +{CC54D096-DBCD-4D93-93A5-899AE DistributionName   : Fedora-WSL1
 +35559B4}                       BasePath           : C:\wsl\Fedora-WSL1
 +                               State              : 1
 +                               Version            : 2
 +                               DefaultEnvironment : {HOSTTYPE=x86_64, LANG=en_US.UTF-8, PATH=/usr/local/sbin:/usr/loc
 +                               al/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, TERM=xterm-256color}
 +                               DefaultUid         : 0
 +                               KernelCommandLine  : BOOT_IMAGE=/kernel init=/init ro
 +                               Flags              : 7
 +{E74B61AB-F675-4518-A0E3-BCEE9 DistributionName   : Fedora
 +C7F8E9C}                       BasePath           : C:\wsl\Fedora
 +                               State              : 1
 +                               Version            : 2
 +                               DefaultEnvironment : {HOSTTYPE=x86_64, LANG=en_US.UTF-8, PATH=/usr/local/sbin:/usr/loc
 +                               al/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, TERM=xterm-256color}
 +                               DefaultUid         : 1000
 +                               KernelCommandLine  : BOOT_IMAGE=/kernel init=/init ro
 +                               Flags              : 15
 +{F9260EF7-5866-4DAC-8E4F-86487 DistributionName   : Fedora32
 +1004DA4}                       BasePath           : C:\wsl\Fedora32
 +                               State              : 1
 +                               Version            : 2
 +                               DefaultEnvironment : {HOSTTYPE=x86_64, LANG=en_US.UTF-8, PATH=/usr/local/sbin:/usr/loc
 +                               al/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games, TERM=xterm-256color}
 +                               DefaultUid         : 0
 +                               KernelCommandLine  : BOOT_IMAGE=/kernel init=/init ro
 +                               Flags              : 15
 +</code>
 +</WRAP>
  
 ==== MSYS2 MinGW 64-bit を追加する ==== ==== MSYS2 MinGW 64-bit を追加する ====
行 359: 行 391:
  
 ===== トラブルシューティング ===== ===== トラブルシューティング =====
 +
 +==== 長時間実行プロセスを Ctrl + C で終了すると PowerShell が終了する ====
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +PowerShell 7.0.2
 +Copyright (c) Microsoft Corporation. All rights reserved.
 +
 +https://aka.ms/powershell
 +Type 'help' to get help.
 +
 +PS C:\Users\nakayama> cd d:\wsl
 +PS D:\wsl> xz .\fedora.tar
 +
 +[プロセスはコード 3221225786 で終了しました]
 +</code>
 +</WRAP>
 +英語では以下のようにシェルが終了する。\\
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +[process exited with code 3221225786]
 +</code>
 +</WRAP>
 +
 +設定 (settings.json) の **"source"** コメントアウトして、以下のように **"commandline"** にフルパス記述するように修正する。\\
 +<WRAP prewrap 100% #result>
 +<code javascript settings.json>
 +        "list":
 +        [
 +            {
 +                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
 +                "hidden": false,
 +                "name": "PowerShell Core",
 +                //"source": "Windows.Terminal.PowershellCore",
 +                "commandline": "%USERPROFILE%\\scoop\\apps\\powershell\\current\\pwsh.exe",
 +                "icon": "%USERPROFILE%\\scoop\\apps\\powershell\\current\\assets\\Powershell_av_colors.ico",
 +                "colorScheme": "Campbell",
 +                "startingDirectory" : "%USERPROFILE%"
 +            }
 +        ]
 +</code>
 +</WRAP>
 +
 +[[https://github.com/PowerShell/PowerShell/issues/11314|pwsh as a dotnet global tool exhibits very unusual behavior with Ctrl-C · Issue #11314 · PowerShell/PowerShell · GitHub]]\\
  
 ==== バージョンアップ後にユーザー設定読み込みエラーが発生する ==== ==== バージョンアップ後にユーザー設定読み込みエラーが発生する ====
行 374: 行 449:
 </code> </code>
 </WRAP> </WRAP>
-{{:windows:windows_terminal_settings_error_001.png?400|"globals" プロパティは廃止}}\\+{{windows:windows_terminal_settings_error_001.png?400|"globals" プロパティは廃止}}\\
  
 以下のような "globals" プロパティの場合\\ 以下のような "globals" プロパティの場合\\
行 417: 行 492:
  
 ===== 参考文献 ===== ===== 参考文献 =====
 +[[https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md|Windows Terminal User Documentation]]\\
 +[[https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md|Editing Windows Terminal JSON Settings]]\\
 +\\
 [[https://qiita.com/rubytomato@github/items/e88cab84f36e44797cf2|Windows Terminal (Preview) メモ - Qiita]]\\ [[https://qiita.com/rubytomato@github/items/e88cab84f36e44797cf2|Windows Terminal (Preview) メモ - Qiita]]\\
 [[https://qiita.com/tawara_/items/374f3ca0a386fab8b305|【文字幅 半角3:全角5 も追加】Ricty を神フォントだと崇める僕が、フリーライセンスのプログラミングフォント「白源」を作った話 - Qiita]]\\ [[https://qiita.com/tawara_/items/374f3ca0a386fab8b305|【文字幅 半角3:全角5 も追加】Ricty を神フォントだと崇める僕が、フリーライセンスのプログラミングフォント「白源」を作った話 - Qiita]]\\
 +[[https://qiita.com/whim0321/items/6a6b11dea54642bd6724|Windows Terminal Tips - Qiita]]\\
 \\ \\
 [[https://docs.microsoft.com/ja-jp/windows/terminal/customize-settings/color-schemes|Windows ターミナルの配色 | Microsoft Docs]]\\ [[https://docs.microsoft.com/ja-jp/windows/terminal/customize-settings/color-schemes|Windows ターミナルの配色 | Microsoft Docs]]\\
  • windows/windows_terminal.txt
  • 最終更新: 2023/09/20 18:15
  • by ともやん