Skip to main content

WindowTerminial

安装

  • window商店搜索安装
  • github 下载

设置右键打开

# 注册表
# 计算机\HKEY_CLASSES_ROOT\Directory\background\shell
# 新建名为 WT 的项的值为 Open in Windows Terminal
# WT下再新建名为 command 值如下:
cmd.exe /s /c pushd "%V" & "{}\AppData\Local\Microsoft\WindowsApps\wt.exe"

# {} 为 %USERPROFILE% 的路径,必须天绝对路径
C:\Users\M2-WIN10
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\background\shell\WT]
@="Windows Terminal"

[HKEY_CLASSES_ROOT\Directory\background\shell\WT\command]
@="cmd.exe /s /c pushd \"%V\" & \"C:\\Users\\M2-WIN10\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe\""
cmd.exe
/s 表示修改 /c 或 /k 后对 String 的处理。
/c 表示在运行后关闭窗口
pushd %V pushd改变当前目录到指定目录,
并保存当前的目录在堆栈顶端 在此处"%V"为当前工作目录,
所以如果设置起始目录为null则打开当前目录
"路径" 在管理员模式的cmd打开程序
// 修改 windows Terminal 的settigns.json
{
"profiles":{
"list":[
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"startingDirectory" : null, // 此处添加 null 值,即可
"hidden": false,
"name": "Windows PowerShell"
},
]
}
}

以管理员模式启动

Open in Windows Terminal as admin.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\background\shell\runas]
"ShowBasedOnVelocityId"=dword:00639bc8
@="Windows Terminal (as Admin)"

[HKEY_CLASSES_ROOT\Directory\background\shell\runas\command]
@="cmd.exe /s /c pushd \"%V\" & \"C:\\Users\\M2-WIN10\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe\""

配置文件

配色方案