配置Windows Terminal在任意目录打开的方法
terminal
The new Windows Terminal and the original Windows console host, all in the same place!
项目地址:https://gitcode.com/gh_mirrors/term/terminal
免费下载资源
·
采用知乎上的一种配置方法,放出地址,并简化一下配置过程:
首先我们要创建一个新文件夹存放注册表和我们的ico图标,作者推荐在这里创建:
C:\Users\starinsun\AppData\Local\terminal
这里需要使用常量:“USERPROFILE”,我的指向是个人文件夹:
C:\WINDOWS\System32>echo %USERPROFILE%
C:\Users\starinsun
然后创建注册表文件“wt.reg”
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows terminal here"
"Icon"="%USERPROFILE%\\AppData\\Local\\terminal\\wt_32.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\\Users\\starinsun\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"
最后双击运行即可。
其实还有其他很多种配置方法,有人说直接把powershell 的注册改掉即可,其实我觉得很多人和我一样困在这个问题不是注册表之类的东西不熟悉或者不会写,而是找不到wt.exe这个UWP应用的exe文件在哪儿:
"C:\\Users\\starinsun\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"
Here You Are.
11.20 更新
随着新版本的更新,WT配置中出现了一个默认的JSON文件,来存储一些默认配置,包括azure的命令行打开,所以上述方法设置完成之后发现一切都没有变化,不管你在哪里打开,他都会默认从你的用户目录中打开。
发现这个问题是因为我想把默认终端切换到powershell,就把之前的配置删掉了。
这是因为default.json中每个profie添加了一个startdirectory的属性,默认指向你的用户目录,所以我们只需要在profile.json中把这个配置覆盖掉即可,添加一下字段
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"cursorShape": "emptyBox",
"colorScheme": "Material Dark",
"useAcrylic": true,
"acrylicOpacity": 0.8,
"fontFace": "Fira Code",
"fontSize": 11,
"hidden": false,
"startingDirectory": null //新添加的
},
GitHub 加速计划 / term / terminal
94.53 K
8.17 K
下载
The new Windows Terminal and the original Windows console host, all in the same place!
最近提交(Master分支:2 个月前 )
d04381ec
"HighContrast" is not a possible requested theme. So `_UpdateBackgroundForMica()` would force the settings UI to be light or dark. To fix this, we just check if we're in high contrast mode and, if so, we don't bother setting the requested theme. 9 天前
e83434ff
Turns out that having the styles for the KeyChordText and ParsedCommandLineText be empty for high contrast mode caused the issue. Since we're already using theme resources for the colors, we automatically adjust properly to whatever the high contrast theme is (Thanks XAML!).
Bonus points:
- we didn't need the theme dictionaries anymore, so I just moved them to the ResourceDictionary directly
- ParsedCommandLineTextBlockStyle isn't used. So I removed it altogether.
Validated command palette with multiple high contrast themes. See PR thread for demo.
Closes #17914 9 天前
更多推荐
已为社区贡献1条内容
所有评论(0)