本文最后更新于:1 个月前

sCF6IJ.png

Terminal

  • 是我开发历程中,接触的、第二个微软Microsoft开源的开发者工具
    • 第一个是VS Code)。
  • 吸引我的是
    • 高自定义性
    • 可扩展性
    • UI(个人审美比较……hh

详细配置

毛玻璃

  • 在配置文件profiles.json中的profiles,设置参数
"profiles": 
[
	{
	//开启毛玻璃特效
	"useAcrylic": true,
	}
],

设置 Powerline

来自微软官方文档

  • Powerline 提供自定义的命令提示符体验,提供 Git 状态颜色编码和提示符。

右键添加“在此处打开Terminal”

s9D6Qs.png

  • 新建一个注册表文件.reg,内容如下:
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows Terminal Here"
"Icon"="C:\\Users\\Administrator\\terminal.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\\Program

参考文章

  1. 微软官方文档
  2. windows terminal安装与毛玻璃教程
  3. Windows Terminal 完美配置 PowerShell 7.1

更多配色方案

https://windowsterminalthemes.dev/

完整配置文件


// 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",
    "theme": "dark",
        "profiles": [
            {
                "name" : "Powershell",
                "source" : "Windows.Terminal.PowershellCore",
                "acrylicOpacity" : 0.3,
                "colorScheme" : "Campbell",
                "cursorColor" : "#FFFFFD",
                "fontFace" : "Cascadia Code PL",
                "useAcrylic" : true,
                "acrylic" : 0.3
            }
        ],

    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles
            //将"在此处启动Windows Terminal"添加到右键菜单
            "startingDirectory" : ".",
        },
        "list":
        [
			{
				// Powershell 7.1.0-preview.2 配置
				"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
				"hidden": false,
				"name": "pwsh",
				// 注意:一定要写上 -nologo,否则开启 powershll 会有一段话输出,很讨厌!
				"commandline": "C:/Program Files/PowerShell/7-preview/pwsh.exe -nologo",
				"source": "Windows.Terminal.PowershellCore",
				// 启动菜单一定要设置为 <.>,否则后面重要的一步将会无效!
				"startingDirectory": ".",
				// 字体
				"fontFace": "Cascadia Code PL",
				"fontSize": 11,
				"historySize": 9001,
				"padding": "5, 5, 20, 25",
				"snapOnInput": true,
				"useAcrylic": false,
				//配色方案
				"colorScheme": "PencilDark",
				//透明度
				"backgroundImageOpacity" : 0.1,
				//毛玻璃
				"useAcrylic" : true,
				//标题
				"tabTitle" : "PowerShell",
				//未知
				"acrylicOpacity": 0.1,
			},
            {
                // Make changes here to the powershell.exe profile
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false,
                //配色方案
				"colorScheme": "Raspberry",
				//透明度
				"backgroundImageOpacity" : 0.1,
				//毛玻璃
				"useAcrylic" : true,
            },
            {
                // Make changes here to the cmd.exe profile
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd",
                "commandline": "cmd.exe",
                "hidden": false,
                //配色方案
				"colorScheme": "rebecca",
				//透明度
				"backgroundImageOpacity" : 0.3,
				//毛玻璃
				"useAcrylic" : true,
				//未知
				"acrylicOpacity": 0.1,
				"acrylic" : 0.3,
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl",
                "hidden": false,
                //配色方案
				"colorScheme": "Solarized Darcula",
				//透明度
				"backgroundImageOpacity" : 0.3,
				//毛玻璃
				"useAcrylic" : true,
				//未知
				"acrylicOpacity": 0.1,
				"acrylic" : 0.3,
            },
			{
				// Git Bash
				//"closeOnExit": true,
				"commandline": "E:\\Git\\usr\\bin\\bash.exe",
				//"cursorColor": "#FFFFFF",
				"hidden" : false,
				//"cursorShape": "bar",
				"guid":"{cd411374-e41f-49dd-8ace-4f2b42b6cffa}",
				//"historySize": 9001,
			    "icon":"E:\\Git\\mingw64\\share\\git\\git-for-windows.ico",
				"name":"Git Bash",
				//"padding": "0,0,0,0",
				//"snapOnInput": true,
				//"startingDirectory": "%USERPROFILE%",
				// 启动菜单一定要设置为 <.>,否则后面重要的一步将会无效!
				"startingDirectory": ".",
				// 字体
				"fontFace": "Cascadia Code PL",
				"fontSize": 11,
				"historySize": 9001,
				"padding": "5, 5, 20, 25",
				"snapOnInput": true,
				"useAcrylic": false,
				//配色方案
				"colorScheme": "PencilDark",
				//透明度
				"backgroundImageOpacity" : 0.1,
				//毛玻璃
				"useAcrylic" : true,
				//标题
				"tabTitle" : "PowerShell",
				//未知
				"acrylicOpacity": 0.1,
			},
        ]
    },

    // Add custom color schemes to this array
    "schemes": [
		{
			//默认
			//配色方案
			"name": "Homebrew",
			"black": "#000000",
			"red": "#FC5275",
			"green": "#00a600",
			"yellow": "#999900",
			"blue": "#6666e9",
			"purple": "#b200b2",
			"cyan": "#00a6b2",
			"white": "#bfbfbf",
			"brightBlack": "#666666",
			"brightRed": "#e50000",
			"brightGreen": "#00d900",
			"brightYellow": "#e5e500",
			"brightBlue": "#0000ff",
			"brightPurple": "#e500e5",
			"brightCyan": "#00e5e5",
			"brightWhite": "#e5e5e5",
			"background": "#757575",
			"foreground": "#00ff00"
		},
		{
			//配色方案
			//Ubuntu款式
            "name" : "Raspberry",
            "background" : "#3C0315",
            "black" : "#282A2E",
            "blue" : "#0170C5",
            "brightBlack" : "#676E7A",
            "brightBlue" : "#80c8ff",
            "brightCyan" : "#8ABEB7",
            "brightGreen" : "#B5D680",
            "brightPurple" : "#AC79BB",
            "brightRed" : "#BD6D85",
            "brightWhite" : "#FFFFFD",
            "brightYellow" : "#FFFD76",
            "cyan" : "#3F8D83",
            "foreground" : "#FFFFFD",
            "green" : "#76AB23",
            "purple" : "#7D498F",
            "red" : "#BD0940",
            "white" : "#FFFFFD",
            "yellow" : "#E0DE48",
            "foreground": "#00ff00"
         },
         {
			"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": "Solarized Darcula",
			"black": "#25292a",
			"red": "#f24840",
			"green": "#629655",
			"yellow": "#b68800",
			"blue": "#2075c7",
			"purple": "#797fd4",
			"cyan": "#15968d",
			"white": "#d2d8d9",
			"brightBlack": "#25292a",
			"brightRed": "#f24840",
			"brightGreen": "#629655",
			"brightYellow": "#b68800",
			"brightBlue": "#2075c7",
			"brightPurple": "#797fd4",
			"brightCyan": "#15968d",
			"brightWhite": "#d2d8d9",
			"background": "#3d3f41",
			"foreground": "#d2d8d9"
		},
		{
			"name": "rebecca",
			"black": "#12131e",
			"red": "#dd7755",
			"green": "#04dbb5",
			"yellow": "#f2e7b7",
			"blue": "#7aa5ff",
			"purple": "#bf9cf9",
			"cyan": "#56d3c2",
			"white": "#e4e3e9",
			"brightBlack": "#666699",
			"brightRed": "#ff92cd",
			"brightGreen": "#01eac0",
			"brightYellow": "#fffca8",
			"brightBlue": "#69c0fa",
			"brightPurple": "#c17ff8",
			"brightCyan": "#8bfde1",
			"brightWhite": "#f4f2f9",
			"background": "#292a44",
			"foreground": "#e8e6ed"
		},
		{
			"name": "PencilDark",
			"black": "#212121",
			"red": "#c30771",
			"green": "#10a778",
			"yellow": "#a89c14",
			"blue": "#008ec4",
			"purple": "#523c79",
			"cyan": "#20a5ba",
			"white": "#d9d9d9",
			"brightBlack": "#424242",
			"brightRed": "#fb007a",
			"brightGreen": "#5fd7af",
			"brightYellow": "#f3e430",
			"brightBlue": "#20bbfc",
			"brightPurple": "#6855de",
			"brightCyan": "#4fb8cc",
			"brightWhite": "#f1f1f1",
			"background": "#212121",
			"foreground": "#f1f1f1"
		},
    ],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": [
		// Press ctrl+shift+f to open the search box
		//自定义搜索键绑定
        { "command": "find", "keys": "ctrl+f" },
    ]
}

 目录