powershell配置(4)-windows-terminal

1.安装

可在应用商店安装,也可以scoop安装。

1
scoop install windows-terminal

2. 配置文件

在设置里直接打开的是个人配置:setting.json

按下alt再打开是默认配置文件:default.json

直接默认文件的内容全部拷贝到个人配置里。

简单的改一下powershell的设置,主题、字体、启动目录。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"profiles":
[
{
"guid": "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}",
"name": "Windows PowerShell",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"icon": "ms-appx:///ProfileIcons/{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}.png",
"colorScheme": "Campbell",
"antialiasingMode": "grayscale",
"closeOnExit": "graceful",
"cursorShape": "bar",
"fontFace": "JetBrains Mono",
"fontSize": 11,
"hidden": false,
"historySize": 9001,
"padding": "8, 8, 8, 8",
"snapOnInput": true,
"altGrAliasing": true,
"startingDirectory": "%USERPROFILE%",
"useAcrylic": false
},
]

3. 加入右键菜单

  • 新建注册表文件 windows terminal here.reg, 内容如下(路径按需修改)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &terminal]
    @="Open with &terminal"
    "Icon"="\"C:\\Users\\xxxx\\scoop\\apps\\windows-terminal\\current\\windowsterminal.exe\""

    [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &terminal\command]
    @="\"C:\\Users\\xxxx\\scoop\\apps\\windows-terminal\\current\\windowsterminal.exe\""