Windows Terminal添加到鼠标右键

it2025-10-24  12

Windows Terminal

Windows Terminal 右键顺滑上手

折腾博客主题的时候看见了Windows Terminal的快捷打开方式,那就试试~

如果Windows上有比从cmd和PowerShell好用的终端,还能添加到鼠标右键菜单,你想要试试吗?

下载Windows Terminal

Windows Teriminl

并且,这个是支持自己去编译的,如果你够厉害,可以根据自己需要修改源文件,github上有源文件。

GitHub - microsoft/terminal: The new Windows Terminal, and the original Windows console host - all in the same place!

添加Windows Terminal到右键菜单

测试变量

先检测下边两个变量是否可以正常输出

第一种: echo %USERPROFILE% echo %LOCALAPPDATA%

如果输出的是%USERPROFILE%和%LOCALAPPDATA%或者报错的情况下,替换掉%USERPROFILE%和%LOCALAPPDATA%,如下所示,在reg文档中同样:

第二种: echo C:\Users\[userName] echo C:\Users\[userName]\AppData\Local

如果使用的是第一种,后边的命令行就都可以使用第一种,如果是第二种,后边操作中的文件路径都使用绝对路径

[userName]是你的用户名

创建terminal文件夹

打开命令行,输入

mkdir "%USERPROFILE%\AppData\Local\terminal"

或者直接在文件管理器[userName]\AppData\Local\直接新建teriminal文件夹。

写入注册表

在Terminal中创建txt文档,后缀名为reg, 右键菜单会出现Windows Terminal的当时有两种,一种是:shift+鼠标右键,另一种是:鼠标右键。接下来根据自己需要选择两种方式中的一种即可:

shift+鼠标右键

把下边的内容复制到reg中:

Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\wt] @="Windows Terminal" "Extended"="" [HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command] @="C:\\Users\\[userName]\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

注意:需要把[userName]改为自己电脑的用户名

右键

把下边内容复制到reg中:

Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\wt] @="Windows terminal here" [HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command] @="C:\\Users\\[userName]\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

注意:需要把[userName]改为自己电脑的用户名

修改Windows Terminal的profile.json

打开profile.json

然后按照下图修改对应的内容就可以:

"startingDirectory": null

到此,就成功把Terminal添加到鼠标右键了

最新回复(0)