Windows Terminal——安装并配置主题

2024-08-16 12:51:57 浏览数 (1)

前言

官方文档 | 官方文档

GIT地址 | 项目地址 Windows 终端是一个面向命令行工具和 shell(如命令提示符、PowerShell 和适用于 Linux 的 Windows 子系统 (WSL))用户的新式终端应用程序。 它的主要功能包括多个选项卡、窗格、Unicode 和 UTF-8 字符支持、GPU 加速文本呈现引擎,还可以用于创建你自己的主题并自定义文本、颜色、背景和快捷键绑定。

步骤

安装终端

打开windows的商店——>搜索'Windows Terminal'——>进入到详情页——>点击'获取'(如果安装过那就是启动)

修改配置

安装完成后,打开终端进行配置

具体配置文件如下,剩下的我们直接在配置里面讲解主要为两种

  1. 直接在list中修改。
  2. schemes配置好,在list中引用。
代码语言:javascript复制
// This file was initially generated by Windows Terminal 1.0.1401.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.
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", //每个电脑是唯一的
                "name": "PowerShell",
                "commandline": "powershell.exe",
                "hidden": false,
                "acrylicOpacity" : 0.75,
                "colorScheme" : "Solarized Dark", //这个配色的名称是为我们在schemes中配置的
                "fontFace" : "Consolas",
                "useAcrylic" : true //打开毛玻璃的效果
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd",
                "commandline": "cmd.exe",
                "hidden": false,
                "acrylicOpacity" : 0.75, 
                "backgroundImage" : "E://图片//wallhaven-694674.jpg",  //背景图片
                "backgroundImageOpacity" : 0.5, //背景透明度
                "closeOnExit" : true,
                "cursorColor" : "#FFFFFF",
                "cursorShape" : "bar",
                "fontFace" : "Consolas",
                "fontSize" : 12,
                "historySize" : 9001,
                "padding" : "0, 0, 0, 0",
                "snapOnInput" : true,
                "startingDirectory" : "%USERPROFILE%",
                "tabTitle" : "cmd",
                "useAcrylic" : true
            },
            {
                "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
                "hidden": false,
                "name": "Ubuntu-18.04",
                "source": "Windows.Terminal.Wsl",
                "acrylicOpacity" : 0.75,
                "backgroundImage" : "E://图片//wallhaven-694674.jpg", 
                "backgroundImageOpacity" : 0.5,
                "closeOnExit" : true,
                "cursorShape" : "bar",
                "fontFace" : "Consolas",
                "fontSize" : 12,
                "historySize" : 9001,
                "padding" : "0, 0, 0, 0",
                "snapOnInput" : true,
                "startingDirectory" : "%USERPROFILE%",
                "tabTitle" : "Ubuntu-18.04",
                "useAcrylic" : true,
                "cursorColor": "#FFFFFF"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure",
                "acrylicOpacity" : 0.75,
                "backgroundImage" : "E://图片//wallhaven-694674.jpg", 
                "backgroundImageOpacity" : 0.5,
                "closeOnExit" : true,
                "cursorColor" : "#FFFFFF",
                "cursorShape" : "bar",
                "fontFace" : "Consolas",
                "fontSize" : 12,
                "historySize" : 9001,
                "padding" : "0, 0, 0, 0",
                "snapOnInput" : true,
                "startingDirectory" : "%USERPROFILE%",
                "tabTitle" : "Azure Cloud Shell",
                "useAcrylic" : true
            }
        ]
    },

    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    //将我们所有的主题配色在这里写好,我们会在前面用到
        "schemes": [
            {
                "name" : "Frost",
                "background" : "#FFFFFF",
                "black" : "#3C5712",
                "blue" : "#17b2ff",
                "brightBlack" : "#749B36",
                "brightBlue" : "#27B2F6",
                "brightCyan" : "#13A8C0",
                "brightGreen" : "#89AF50",
                "brightPurple" : "#F2A20A",
                "brightRed" : "#F49B36",
                "brightWhite" : "#741274",
                "brightYellow" : "#991070",
                "cyan" : "#3C96A6",
                "foreground" : "#000000",
                "green" : "#6AAE08",
                "purple" : "#991070",
                "red" : "#8D0C0C",
                "white" : "#6E386E",
                "yellow" : "#991070"
            },
            {
                "name": "Campbell",
                "foreground": "#CCCCCC",
                "background": "#0C0C0C",
                "cursorColor": "#FFFFFF",
                "black": "#0C0C0C",
                "red": "#C50F1F",
                "green": "#13A10E",
                "yellow": "#C19C00",
                "blue": "#0037DA",
                "purple": "#881798",
                "cyan": "#3A96DD",
                "white": "#CCCCCC",
                "brightBlack": "#767676",
                "brightRed": "#E74856",
                "brightGreen": "#16C60C",
                "brightYellow": "#F9F1A5",
                "brightBlue": "#3B78FF",
                "brightPurple": "#B4009E",
                "brightCyan": "#61D6D6",
                "brightWhite": "#F2F2F2"
            },
            {
                "name": "Campbell Powershell",
                "foreground": "#CCCCCC",
                "background": "#012456",
                "cursorColor": "#FFFFFF",
                "black": "#0C0C0C",
                "red": "#C50F1F",
                "green": "#13A10E",
                "yellow": "#C19C00",
                "blue": "#0037DA",
                "purple": "#881798",
                "cyan": "#3A96DD",
                "white": "#CCCCCC",
                "brightBlack": "#767676",
                "brightRed": "#E74856",
                "brightGreen": "#16C60C",
                "brightYellow": "#F9F1A5",
                "brightBlue": "#3B78FF",
                "brightPurple": "#B4009E",
                "brightCyan": "#61D6D6",
                "brightWhite": "#F2F2F2"
            },
            {
                "name": "Vintage",
                "foreground": "#C0C0C0",
                "background": "#000000",
                "cursorColor": "#FFFFFF",
                "black": "#000000",
                "red": "#800000",
                "green": "#008000",
                "yellow": "#808000",
                "blue": "#000080",
                "purple": "#800080",
                "cyan": "#008080",
                "white": "#C0C0C0",
                "brightBlack": "#808080",
                "brightRed": "#FF0000",
                "brightGreen": "#00FF00",
                "brightYellow": "#FFFF00",
                "brightBlue": "#0000FF",
                "brightPurple": "#FF00FF",
                "brightCyan": "#00FFFF",
                "brightWhite": "#FFFFFF"
            },
            {
                "name": "One Half Dark",
                "foreground": "#DCDFE4",
                "background": "#282C34",
                "cursorColor": "#FFFFFF",
                "black": "#282C34",
                "red": "#E06C75",
                "green": "#98C379",
                "yellow": "#E5C07B",
                "blue": "#61AFEF",
                "purple": "#C678DD",
                "cyan": "#56B6C2",
                "white": "#DCDFE4",
                "brightBlack": "#5A6374",
                "brightRed": "#E06C75",
                "brightGreen": "#98C379",
                "brightYellow": "#E5C07B",
                "brightBlue": "#61AFEF",
                "brightPurple": "#C678DD",
                "brightCyan": "#56B6C2",
                "brightWhite": "#DCDFE4"
            },
            {
                "name": "One Half Light",
                "foreground": "#383A42",
                "background": "#FAFAFA",
                "cursorColor": "#4F525D",
                "black": "#383A42",
                "red": "#E45649",
                "green": "#50A14F",
                "yellow": "#C18301",
                "blue": "#0184BC",
                "purple": "#A626A4",
                "cyan": "#0997B3",
                "white": "#FAFAFA",
                "brightBlack": "#4F525D",
                "brightRed": "#DF6C75",
                "brightGreen": "#98C379",
                "brightYellow": "#E4C07A",
                "brightBlue": "#61AFEF",
                "brightPurple": "#C577DD",
                "brightCyan": "#56B5C1",
                "brightWhite": "#FFFFFF"
            },
            {
                "name": "Solarized Dark",
                "foreground": "#839496",
                "background": "#002B36",
                "cursorColor": "#FFFFFF",
                "black": "#073642",
                "red": "#DC322F",
                "green": "#859900",
                "yellow": "#B58900",
                "blue": "#268BD2",
                "purple": "#D33682",
                "cyan": "#2AA198",
                "white": "#EEE8D5",
                "brightBlack": "#002B36",
                "brightRed": "#CB4B16",
                "brightGreen": "#586E75",
                "brightYellow": "#657B83",
                "brightBlue": "#839496",
                "brightPurple": "#6C71C4",
                "brightCyan": "#93A1A1",
                "brightWhite": "#FDF6E3"
            },
            {
                "name": "Solarized Light",
                "foreground": "#657B83",
                "background": "#FDF6E3",
                "cursorColor": "#002B36",
                "black": "#073642",
                "red": "#DC322F",
                "green": "#859900",
                "yellow": "#B58900",
                "blue": "#268BD2",
                "purple": "#D33682",
                "cyan": "#2AA198",
                "white": "#EEE8D5",
                "brightBlack": "#002B36",
                "brightRed": "#CB4B16",
                "brightGreen": "#586E75",
                "brightYellow": "#657B83",
                "brightBlue": "#839496",
                "brightPurple": "#6C71C4",
                "brightCyan": "#93A1A1",
                "brightWhite": "#FDF6E3"
            },
            {
                "name": "Tango Dark",
                "foreground": "#D3D7CF",
                "background": "#000000",
                "cursorColor": "#FFFFFF",
                "black": "#000000",
                "red": "#CC0000",
                "green": "#4E9A06",
                "yellow": "#C4A000",
                "blue": "#3465A4",
                "purple": "#75507B",
                "cyan": "#06989A",
                "white": "#D3D7CF",
                "brightBlack": "#555753",
                "brightRed": "#EF2929",
                "brightGreen": "#8AE234",
                "brightYellow": "#FCE94F",
                "brightBlue": "#729FCF",
                "brightPurple": "#AD7FA8",
                "brightCyan": "#34E2E2",
                "brightWhite": "#EEEEEC"
            },
            {
                "name": "Tango Light",
                "foreground": "#555753",
                "background": "#FFFFFF",
                "cursorColor": "#000000",
                "black": "#000000",
                "red": "#CC0000",
                "green": "#4E9A06",
                "yellow": "#C4A000",
                "blue": "#3465A4",
                "purple": "#75507B",
                "cyan": "#06989A",
                "white": "#D3D7CF",
                "brightBlack": "#555753",
                "brightRed": "#EF2929",
                "brightGreen": "#8AE234",
                "brightYellow": "#FCE94F",
                "brightBlue": "#729FCF",
                "brightPurple": "#AD7FA8",
                "brightCyan": "#34E2E2",
                "brightWhite": "#EEEEEC"
            }
            
        ],

    // 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" },
       
        //close active panle
        { "command": "closePane", "keys": "ctrl shift w" },
        // 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" }
    ]
}

0 人点赞