Skip to content

Instantly share code, notes, and snippets.

@Garwih
Last active September 23, 2023 11:51
  • Star 20 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
将 Windows Terminal 添加到右键菜单

将 Windows Terminal 添加到右键菜单

将以下代码保存到扩展名为 .reg 的文件中,双击打开

需要按住 shift + 右键打开

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows Terminal Here"
"Extended"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\\Users\\你的用户名\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

不需要 shift,直接右键打开

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\\你的用户名\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

当前目录打开时,Terminal 里的路径不是当前目录

检查一下配置文件,看下是否有以下内容,删除之后就可以了。

{
    "profiles": [
        {
            "startingDirectory" : "%USERPROFILE%"
        }
    ]
}

v0.5 之后的版本(如 0.5.2661.0 )需要修改为

"startingDirectory": null

参考:microsoft/terminal#620

@samzhou
Copy link

samzhou commented Oct 7, 2021

按照上面方法打开后还是home目录,按照这个就成功了:

"profiles":
    {
        "defaults":
        {
            "startingDirectory":  null
        },

version: 1.10.2383.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment