Windows Terminal 安装及美化

安装

源码地址:https://github.com/microsoft/Terminal

微软商店地址:https://www.microsoft.com/zh-cn/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab

可以直接从微软商店获取安装,但是对windows 版本的要求为1903及以上,cmd下输入winver可查看当前版本

美化

点击设置,会打开一个 settings.json 文件,直接修改就可以了。下方提供了我的自定义 settings.json 文件。

 settings.json

// This file was initially generated by Windows Terminal 1.1.2021.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 "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": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
 
    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings
 
    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,
 
    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,
 
    // 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://aka.ms/terminal-profile-settings
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
            "acrylicOpacity": 0.5, // useAcrylic 设置为 true 时,设置透明度,接受 0-1 之间的浮点值
            "fontSize": 13, // 文字大小
            "fontFace": "Consolas", // 字体
            "colorScheme":"VibrantTom"
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "命令提示符",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            }
        ]
    },
 
    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [{
        "name": "Builtin Dark",
        "black": "#000000",
        "red": "#bb0000",
        "green": "#00bb00",
        "yellow": "#bbbb00",
        "blue": "#0000bb",
        "purple": "#bb00bb",
        "cyan": "#00bbbb",
        "white": "#bbbbbb",
        "brightBlack": "#555555",
        "brightRed": "#ff5555",
        "brightGreen": "#55ff55",
        "brightYellow": "#ffff55",
        "brightBlue": "#5555ff",
        "brightPurple": "#ff55ff",
        "brightCyan": "#55ffff",
        "brightWhite": "#ffffff",
        "background": "#000000",
        "foreground": "#bbbbbb"
      },
	  {
	    "name": "VibrantTom",
		"background" : "#000000",
		"black" : "#878787",
		"blue" : "#44B4CC",
		"brightBlack" : "#E373C8",
		"brightBlue" : "#0000FF",
		"brightCyan" : "#19D1D8",
		"brightGreen" : "#81EC0D",
		"brightPurple" : "#FF00FF",
		"brightRed" : "#FF0000",
		"brightWhite" : "#E5E5E5",
		"brightYellow" : "#FFD93D",
		"cyan" : "#19D1D8",
		"foreground" : "#FFFFFF",
		"green" : "#CCFF04",
		"purple" : "#9933CC",
		"red" : "#FF6600",
		"white" : "#F5F5F5",
		"yellow" : "#FFD93D"
	  }],
 
    // Add custom keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about keybindings, visit https://aka.ms/terminal-keybindings
    "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://aka.ms/terminal-selection
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },
 
        // Press Ctrl+Shift+F to open the search box
        { "command": "find", "keys": "ctrl+shift+f" },
 
        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]
}

  

Windows Terminal  添加至文件夹右键菜单

新建一个txt文件,填入以下代码,然后把文件的后缀名改为 reg 文件,然后双击运行

  • <user> 改为当前用户名
  • Microsoft.WindowsTerminal_1.1.2021.0_x64__8wekyb3d8bbwe  这个路径可能不准确,因为版本在做升级,安装完 Windows Terminal  之后可以找下正确的路径
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTDirectoryBackgroundshellwt]
@="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.1.2021.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"

[HKEY_CLASSES_ROOTDirectoryBackgroundshellwtcommand]
@="C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\wt.exe -d ."

[HKEY_CLASSES_ROOTDirectoryshellwt]
@="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.1.2021.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"

[HKEY_CLASSES_ROOTDirectoryshellwtcommand]
@="C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\wt.exe -d ."

原文地址:https://www.cnblogs.com/RainFate/p/13392588.html