原文鏈接: vscode 中使用新windows terminal 並修改主題
目前沒有找到能在vscode中使用的辦法... 建議還是cmder吧, 不要瞎折騰了
還是gg好啊, 找了一會就找到了, 浪費我幾個小時用bing和百度...
我單方面宣佈, 這就是最好看的windows終端了
https://docs.microsoft.com/zh-cn/windows/terminal/
https://github.com/microsoft/terminal
https://iterm2colorschemes.com/
https://windowsterminalthemes.dev/
cmder太慢了...所以想試試windows terminal
安裝
直接在應用商店安裝就行
這個看着是觸摸板和手寫板的問題
修改配置文件
~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState\profiles.json
主題切換
https://github.com/Crawler995/wtcolor
報錯 https://blog.csdn.net/hl971115/article/details/102078132
wtcolor : 無法加載文件 C:\Users\Ace\AppData\Roaming\npm\wtcolor.ps1,因爲在此係統上禁止運行腳本。有關詳細信息,請參閱 h
ttps:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
以管理員身份運行ps, 然後重新設置模式
報錯, 原因是文件名修改了
× Open config file failed! Please check the given path.
C:\Users\Ace\AppData\Roaming\npm\node_modules\wtcolor
安裝git支持, powershell 管理員模式運行
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
創建配置文件, 使用$PROFILE可以看到文件位置
New-Item -ItemType file -Path $PROFILE -Force
在配置文件中加入
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme PowerlinePlus
安裝字體
選擇ttf, 然後全部安裝
https://github.com/microsoft/cascadia-code/releases
查看主題
Get-Theme
加入右鍵菜單
添加註冊表, Terminal是新建項, command也是新建項, Icon是新建字符串, command中的值是wt的位置, 圖標用的cmder的
where wt
C:\Users\Ace\AppData\Local\Microsoft\WindowsApps\wt.exe
wt添加啓動目錄
好像也慢了不少啊....
在vscode中使用
好像沒有解決辦法... 每次都會重新彈出來一個新窗口...
"terminal.external.windowsExec": "wt -p cmd cmd",
修改配置文件
"profiles": {
"defaults": {
// "startingDirectory": "./",
"startingDirectory": "%__CD__%",
"fontFace": "Fira Code",
"fontSize": 16,
"useAcrylic": true,
"snapOnInput": true,
"supportApplicationTitle": true
// Put settings here that you want to apply to all profiles.
},
用這種方式吧, ps也是一樣的 , 並且可以去除開始的文字, 可以少加一個clear
"terminal.integrated.shell.windows": "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe",
"terminal.integrated.shellArgs.windows": ["-nologo"],