Windows Terminal使用技巧

配置教程

详细配置参阅Windows Terminal Settings Schema

有关中文翻译参阅

Global

1
2
3
4
5
6
7
8
9
10
11
12
13
{
// 默认的命令行工具
"defaultProfile" : "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
// 窗口宽度
"initialCols" : 90,
// 窗口高度
"initialRows" : 25,
// 默认主题
"requestedTheme" : "system",
// 快捷键配置
"keybindings" : []
...
}

profile

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
{
// 设置命令行的唯一id
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
// 设置命令行显示的名称
"name": "Windows PowerShell",
// 设置命令行执行时候运行的程序
"commandline": "powershell.exe",
// 设置命令行的字体
"fontFace": "Cascadia Code",
// 设置命令行的字体大小
"fontSize": 14,
// 设置是否显示该命令行
"hidden": false,
// 设置启动后所在的路径
"startingDirectory" : null,
// 使用不透明度
"useAcrylic": true,
// 不透明度
"acrylicOpacity": 0.75,
// 退出后关闭
"closeOnExit": true,
// 颜色主题选择(需要在Schema中配置)
"colorScheme": "Campbell",
// 光标颜色
"cursorColor": "#FFFFFF",
// 光标类型,可选值 "vintage" ( ▃ ), "bar" ( ┃ ),
// "underscore" ( ▁ ), "filledBox" ( █ ), "emptyBox" ( ▯ )
"cursorShape": "bar",
// 历史大小
"historySize": 9001,
"padding": "0, 0, 0, 0",
// 嗅探输入
"snapOnInput": true
},

注意:如果每个命令行工具的配置相同,可以配置在default中,表示对所有命令行生效

注意:如果配置中需要填写路径,用Windows中的\时需要进行转义,可以使用/来表示路径

在当前目录打开方法

  1. 配置命令行的startingDirectory为null
  2. 在需要打开的目录中按ctrl + L或者光标定位到文件管理器地址栏
  3. 输入wt,按回车,就会从当前目录中打开Windows Terminal默认的命令行工具

配置键盘切换tab页

  1. 在配置中的keybindings中添加{ "command": { "action": "switchToTab", "index": 0}, "keys": ["ctrl+alt+1"]},
  2. 如果经常打开多个标签页,可以多配置几条信息
  3. 使用ctrl+alt+数字键就可以完成tab页的切换

快捷键

shift + alt + = - 横向分屏

shift + alt + - - 竖向分屏