Bu1'Blog

如果能控制粗鄙的狂喜,就不会有深入骨髓的悲伤。

0%

Terminal配色方案修改方法及在用方案

Ternimal配色方案修改与备份。

0x01 配色修改方法

修改 settings.json文件,可以从Terminal终端直接打开,可以在默认文件夹中打开,路径为:

1
%appdata%\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState

其中的"schemes"字段为具体的配色方案,定义好后在"colorScheme"字段中可以直接引用定义好的方案。

一个包含多种配色方案的网站:

0x02 目前在用配色方案

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// This file was initially generated by Windows Terminal 1.11.2921.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":
[
{
// add schemes.
"colorScheme": "Flat UI Palette v1 Modified",
"useAcrylic": true,
"acrylicOpacity": 0.8,
"padding": "10,10,10,10",
// default
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// add schemes.
"colorScheme": "Flat UI Palette v1 Modified",
"useAcrylic": true,
"acrylicOpacity": 0.8,
"padding": "10,10,10,10",
// 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}",
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
]
},

// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"name": "Flat UI Palette v1 Modified",
"background": "#1c2024",
"black": "#000000",
"blue": "#2980b9",
"foreground": "#ecf0f1",
"green": "#27ae60",
"red": "#e74c3c",
"white": "#ffffff",
"yellow": "#f1c40f",
"cyan": "#16a085",
"purple": "#8e44ad",
"brightBlack": "#52677c",
"brightBlue": "#3498db",
"brightCyan": "#1abc9c",
"brightGreen": "#2ecc71",
"brightPurple": "#9b59b6",
"brightRed": "#e67e22",
"brightWhite": "#ecf0f1",
"brightYellow": "#f1c40f"
},
{
"name": "Gruvbox Dark",
"black": "#1e1e1e",
"red": "#be0f17",
"green": "#868715",
"yellow": "#cc881a",
"blue": "#377375",
"purple": "#a04b73",
"cyan": "#578e57",
"white": "#978771",
"brightBlack": "#7f7061",
"brightRed": "#f73028",
"brightGreen": "#aab01e",
"brightYellow": "#f7b125",
"brightBlue": "#719586",
"brightPurple": "#c77089",
"brightCyan": "#7db669",
"brightWhite": "#e6d4a3",
"background": "#1e1e1e",
"foreground": "#e6d4a3",
"cursorColor": "#e6d4a3",
"selectionBackground": "#e6d4a3"
},
],

// 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效果

image-20211203113609066

CMD效果

image-20211203113651391

0x03 附录参考