0%

winTerminal

Windows terminal 配置备份。

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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
// This file was initially generated by Windows Terminal Preview 1.3.2382.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",
"initialCols": 80, //终端窗口初始宽度
"initialRows": 24, //终端窗口初始高度
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

// You can add more global application settings here.
// To learn more about global settings, visit https://aka.ms/terminal-global-settings
//禁止掉某些自动访问
"disabledProfileSources":["Windows.Terminal.Azure"],
// 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":
[
{
//powershell core
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"colorScheme" : "Dark+",
"fontSize" : 12,
"fontFace":"Cascadia Code PL",
"commandline" :"C:\\Program Files\\PowerShell\\7\\pwsh.exe /NOLOGO",
"startingDirectory" : "./",
"name": "PowerShell 7",
"source": "Windows.Terminal.PowershellCore"
},
// {
// //powershell core admin
// "guid":"{105d27d0-bacb-4395-9928-c31111bc6c1a}",
// "name": "PowerShell(admin)",
// "colorScheme" : "Dark+",
// "commandline" :"C:\\Program Files\\PowerShell\\7\\pwsh.exe -command Start-Process -Verb RunAs wt.exe",
// "fontSize" : 12,
// "fontFace":"Cascadia Code PL",
// "startingDirectory" : "./"
// },
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": true
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"colorScheme" : "Dark+",
"fontSize" : 11,
"fontFace":"Cascadia Code PL",
"name": "Command Prompt",
"commandline": "cmd.exe",
"startingDirectory" : "./",
"hidden": false
},
{
//add vs prompt
"guid":"{835c3db8-1a62-492a-95bd-76684ae3d466}",
"acrylicOpacity" : 0.75,
"closeOnExit" : true,
"colorScheme" : "Dark+",
"commandline" : "%systemroot%\\system32\\cmd.exe /K \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools\\VsDevCmd.bat\"",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace":"Cascadia Code PL",
"fontSize" : 12,
"historySize" : 9001,
"name" : "VS Prompt",
"padding" : "1, 1, 1, 1",
"snapOnInput" : true,
"startingDirectory" : "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools",
"useAcrylic" : true,
"icon":"C:\\Users\\sec\\Pictures\\ico\\visual_studio.ico"

},
{
//add VS 2019 x64 native tools
"guid": "{dfa71a29-353d-461a-850b-04a7bec82a16}",
"acrylicOpacity" : 0.75,
"closeOnExit" : true,
"colorScheme" : "Dark+",
"commandline" : "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvars64.bat\"",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace":"Cascadia Code PL",
"fontSize" : 12,
"historySize" : 9001,
"name" : "x64 for VS 2019 ",
"padding" : "1, 1, 1, 1",
"snapOnInput" : true,
"startingDirectory" : "./",
"useAcrylic" : true,
"icon":"C:\\Users\\sec\\Pictures\\ico\\visual_studio.ico"
},
{
//add VS 2019 x86 native tools
"guid":"{93b194bb-68bb-4169-8abb-8d56bced06ef}",
"acrylicOpacity" : 0.75,
"closeOnExit" : true,
"colorScheme" : "Dark+",
"commandline" : "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvars32.bat\"",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace":"Cascadia Code PL",
"fontSize" : 12,
"historySize" : 9001,
"name" : "x86 for VS 2019 ",
"padding" : "1, 1, 1, 1",
"snapOnInput" : true,
"startingDirectory" : "./",
"useAcrylic" : true,
"icon":"C:\\Users\\sec\\Pictures\\ico\\visual_studio.ico"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": true,
"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": [
{
"background" : "#0C0C0C",
"black" : "#0C0C0C",
"blue" : "#0037DA",
"brightBlack" : "#767676",
"brightBlue" : "#3B78FF",
"brightCyan" : "#61D6D6",
"brightGreen" : "#16C60C",
"brightPurple" : "#B4009E",
"brightRed" : "#E74856",
"brightWhite" : "#F2F2F2",
"brightYellow" : "#F9F1A5",
"cyan" : "#3A96DD",
"foreground" : "#CCCCCC",
"green" : "#13A10E",
"name" : "Campbell",
"purple" : "#881798",
"red" : "#C50F1F",
"white" : "#CCCCCC",
"yellow" : "#C19C00"
},
{
"background" : "#282C34",
"black" : "#282C34",
"blue" : "#61AFEF",
"brightBlack" : "#5A6374",
"brightBlue" : "#61AFEF",
"brightCyan" : "#56B6C2",
"brightGreen" : "#98C379",
"brightPurple" : "#C678DD",
"brightRed" : "#E06C75",
"brightWhite" : "#DCDFE4",
"brightYellow" : "#E5C07B",
"cyan" : "#56B6C2",
"foreground" : "#DCDFE4",
"green" : "#98C379",
"name" : "One Half Dark",
"purple" : "#C678DD",
"red" : "#E06C75",
"white" : "#DCDFE4",
"yellow" : "#E5C07B"
},
{
"background" : "#FAFAFA",
"black" : "#383A42",
"blue" : "#0184BC",
"brightBlack" : "#4F525D",
"brightBlue" : "#61AFEF",
"brightCyan" : "#56B5C1",
"brightGreen" : "#98C379",
"brightPurple" : "#C577DD",
"brightRed" : "#DF6C75",
"brightWhite" : "#FFFFFF",
"brightYellow" : "#E4C07A",
"cyan" : "#0997B3",
"foreground" : "#383A42",
"green" : "#50A14F",
"name" : "One Half Light",
"purple" : "#A626A4",
"red" : "#E45649",
"white" : "#FAFAFA",
"yellow" : "#C18301"
},
{
"background" : "#002B36",
"black" : "#073642",
"blue" : "#268BD2",
"brightBlack" : "#002B36",
"brightBlue" : "#839496",
"brightCyan" : "#93A1A1",
"brightGreen" : "#586E75",
"brightPurple" : "#6C71C4",
"brightRed" : "#CB4B16",
"brightWhite" : "#FDF6E3",
"brightYellow" : "#657B83",
"cyan" : "#2AA198",
"foreground" : "#839496",
"green" : "#859900",
"name" : "Solarized Dark",
"purple" : "#D33682",
"red" : "#DC322F",
"white" : "#EEE8D5",
"yellow" : "#B58900"
},
{
"background" : "#FDF6E3",
"black" : "#073642",
"blue" : "#268BD2",
"brightBlack" : "#002B36",
"brightBlue" : "#839496",
"brightCyan" : "#93A1A1",
"brightGreen" : "#586E75",
"brightPurple" : "#6C71C4",
"brightRed" : "#CB4B16",
"brightWhite" : "#FDF6E3",
"brightYellow" : "#657B83",
"cyan" : "#2AA198",
"foreground" : "#657B83",
"green" : "#859900",
"name" : "Solarized Light",
"purple" : "#D33682",
"red" : "#DC322F",
"white" : "#EEE8D5",
"yellow" : "#B58900"
},
{
"name": "MaterialDark",
"black": "#212121",
"red": "#b7141f",
"green": "#457b24",
"yellow": "#f6981e",
"blue": "#134eb2",
"purple": "#560088",
"cyan": "#0e717c",
"white": "#efefef",
"brightBlack": "#424242",
"brightRed": "#e83b3f",
"brightGreen": "#7aba3a",
"brightYellow": "#ffea2e",
"brightBlue": "#54a4f3",
"brightPurple": "#aa4dbc",
"brightCyan": "#26bbd1",
"brightWhite": "#d9d9d9",
"background": "#232322",
"foreground": "#e5e5e5"
},
{
"name": "Dark+",
"black": "#000000",
"red": "#cd3131",
"green": "#0dbc79",
"yellow": "#e5e510",
"blue": "#2472c8",
"purple": "#bc3fbc",
"cyan": "#11a8cd",
"white": "#e5e5e5",
"brightBlack": "#666666",
"brightRed": "#f14c4c",
"brightGreen": "#23d18b",
"brightYellow": "#f5f543",
"brightBlue": "#3b8eea",
"brightPurple": "#d670d6",
"brightCyan": "#29b8db",
"brightWhite": "#e5e5e5",
"background": "#0e0e0e",
"foreground": "#cccccc"
}
],

// 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" },
{ "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" }
]
}

另外关于管理员权限部分,一开始使用的是这个配置,一个问题就是会弹出一个新的terminal。

1
2
3
4
5
6
7
8
9
10
{   
//powershell core admin
"guid":"{105d27d0-bacb-4395-9928-c31111bc6c1a}",
"name": "PowerShell(admin)",
"colorScheme" : "Dark+",
"commandline" :"C:\\Program Files\\PowerShell\\7\\pwsh.exe -command Start-Process -Verb RunAs wt.exe",
"fontSize" : 12,
"fontFace":"Cascadia Code PL",
"startingDirectory" : "./"
}

今天在github发现了一个库gsudo。目前可以完美满足需求。

一行安装

1
PowerShell -Command "Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex"