Windows 终端配置
添加git命令行
参考上文中的命令行环境配置
主题美化
按照博客里面设置无效,后来发现配置需要分开放置到list和scheme中:
注意下面的Caskaydia Cove Regular Nerd Font Complete Windows Compatible.otf字体需要提前安装。
// This file was initially generated by Windows Terminal 1.9.1942.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": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", // 默认启动的终端
// 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.
"startingDirectory": "D:\\Ubuntu", // 初始目录
"fontFace": "CaskaydiaCove NF", // Caskaydia Cove Regular Nerd Font Complete Windows Compatible.otf
"fontSize": 14,
"historySize": 9001,
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"padding": "0, 0, 0, 0",
"snapOnInput": true,
"closeOnExit": "graceful"
},
"list":
[
{
"tabTitle": "PowerShell", // 标签页名称
"name": "PowerShell", // 命令行名称
"commandline": "powershell.exe", // 适用的命令行
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", // 命令行工具的 guid
"backgroundImage": "D:\\ageovb\\Pictures\\miku.jpg", // 背景图
"backgroundImageOpacity": 0.25,
"backgroundImageStretchMode": "fill",
"colorScheme": "Abernathy", // schemes 中的配色方案
"foreground": "#DCDCDC",
"useAcrylic": true, // 毛玻璃效果
"acrylicOpacity": 0.7
// "icon": "",
},
{
"tabTitle": "Ubuntu", // 标签页名称
"name": "Ubuntu", // 命令行名称
"source": "Windows.Terminal.Wsl", // 适用的命令行
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", // 命令行工具的 guid
"backgroundImage": "D:\\ageovb\\Pictures\\miku.jpg", // 背景图
"backgroundImageOpacity": 0.25,
"backgroundImageStretchMode": "fill",
"colorScheme": "Ubuntu", // schemes 中的配色方案
"foreground": "#DCDCDC",
"useAcrylic": true, // 毛玻璃效果
"acrylicOpacity": 0.7,
"icon": "D:\\ageovb\\Pictures\\Ubuntu.png" // 标题行图标
},
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "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": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"source": "Windows.Terminal.Wsl"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b7}",
"hidden": false,
"name": "git bash",
"commandline": "D:\\Program Files\\Git\\bin\\bash.exe"
}
]
},
// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"name": "Abernathy",
"black": "#000000",
"red": "#cd0000",
"green": "#00cd00",
"yellow": "#cdcd00",
"blue": "#1093f5",
"purple": "#cd00cd",
"cyan": "#00cdcd",
"white": "#faebd7",
"brightBlack": "#404040",
"brightRed": "#ff0000",
"brightGreen": "#00ff00",
"brightYellow": "#ffff00",
"brightBlue": "#11b5f6",
"brightPurple": "#ff00ff",
"brightCyan": "#00ffff",
"brightWhite": "#ffffff",
"background": "#111416",
"foreground": "#eeeeec",
"selectionBackground": "#eeeeec",
"cursorColor": "#bbbbbb"
},
{
"name": "Ubuntu",
"black": "#2e3436",
"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",
"background": "#300a24",
"foreground": "#eeeeec",
"selectionBackground": "#b5d5ff",
"cursorColor": "#bbbbbb"
}
],
// Add custom actions and keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
"actions":
[
// 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" }
]
}
Powershell美化
Windows也有类似oh-my-zsh这样在Linux和Macos上运行的命令行美化工具,名为oh-my-posh,这里请参考对应章节。