我在 PowerShell 中使用 oh-my-posh,它在 git 存储库中速度非常慢。在常规目录中,如果我按 Enter 键,则会立即出现新行。但是,如果我在 git repos 中按 Enter 键,则需要 1-2 秒才能出现新行。这是我的个人资料:
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#91ddff",
"foreground": "#100e23",
"powerline_symbol": "",
"properties": {
"folder_icon": "",
"folder_separator_icon": " ",
"home_icon": "",
"style": "agnoster"
},
"style": "powerline",
"type": "path"
},
{
"background": "#95ffa4",
"foreground": "#193549",
"powerline_symbol": "",
"style": "powerline",
"type": "git",
"properties": {
"display_status": true,
"display_stash_count": true,
"display_upstream_icon": true
}
},
{
"background": "#906cff",
"foreground": "#100e23",
"powerline_symbol": "",
"properties": {
"prefix": " "
},
"style": "powerline",
"type": "python"
},
{
"background": "#ff8080",
"foreground": "#ffffff",
"powerline_symbol": "",
"style": "powerline",
"type": "exit"
}
],
"type": "prompt"
}
],
"final_space": true
}
我也尝试将
display_status
、display_stash_count
和 display_upstream_icon
设置为 false,但这对性能几乎没有任何作用。有什么想法吗?
根据此链接,您应该在
"fetch_status": false
中附加"properties"
:
"properties": {
"display_stash_count": true,
"display_status": true,
"display_upstream_icon": true,
"fetch_status": false // add this
},
重新启动你的终端,你可以看到状态图标消失,性能得到改善。