Windows Terminal(哦,我的posh)在我尝试过的任何事情之后都不会显示git状态
Description
-
我导入POSH-GIT,但不要使用其及时的样式。和我的Windows Terminal $ profile,例如:
-
进口模块posh-git 进口模块OH-MY POSH Set -Posh Prompt-主题默认值 #$ env:posh_git_enabled = $ true
-
我已经阅读了类似的问题[ Windows terminal + OH - 我的posh不显示git状态并使主题文件更改,但也行不通。
-
主题文件的“ git”段如:
{ “ type”:“ git”, “背景”:“ P:绿色”, “ background_templates”:[ “ {{if或(.working.changed)(.staging.changed)}}} p:yellow {{end}}”, “ {{{if和(gt .ahead 0)(gt .behind 0)}}} p:red {{end}}”, “ {{ifgt .ahead 0}}#49416d {{end}}”, “ {{ifgt .behind 0}}#7a306c {{end}}” ],, “前景”:“ P:Black”, “ foreground_templates”:[ “ {{if或(.working.changed)(.staging.changed)}}} p:black {{end}}”, “ {{{if和(gt .ahead 0)(gt .behind 0)}}} p:white {{end}}”, “ {{ifgt .ahead 0}} p:white {{end}}” ],, “ powerline_symbol”:“ \ ue0b0”, “特性”: { “ display_status”:是的, “ display_stash_count”:是的, “ display_upstream_icon”:是的, “ branch_max_length”:25, “ fetch_status”:是的, “ fetch_upstream_icon”:是的, “ github_icon”:“ \ uf7a3” },, “样式”:“ Powerline”, “ template”:“ {{if .upstreamurl}}} {{url .upstreamicon .upstreamurl}}}}}} {{end}} {.head}} {.head}} {.branchstatus}}}} {.working.string}}} {{end}} {{if .staging.changed}}} \ uf046 {{.staging.String}}}} {eend}} {end end}}}}} },,
所有显示属性(“ display_status” ...)都是True。
-
图像:
它不显示git状态!!为什么??
我
只想知道oh-my-posh是否已弃用了git状态显示??
我已经阅读了 oh-my-posh博客页面,Git状态显示没有更改
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
oh-my-posh
已弃用了他们的powershell模块,。因此,作为第一步,运行文档中概述的迁移步骤,并替换
import-module oh-my-posh
以及set poshprompt- theme default
with for,for,for例如,uncomment
so
posh-git
已启用。posh-git
提示被默认禁用::在
posh-git readme
,它说:
很好,所以这就是我们所追求的:在
oh-my-posh
上使用posh-git
提示。那么我们如何将后者纳入前者?在您的
oh-my-posh.omp.json
配置文件,添加段 处于您选择的位置:这里的相关区别在于,这是类型
poshgit
,而不是类型git> git
(后者是oh-my-posh 据我所知,“内置”)。
这对我™有效,作为第一个近似值。您需要添加自定义
foreground_template
魔术等以进一步自定义,但是这些设置应允许posh-git
提示至少从中显示至少显示哦,我的posh
一个。oh-my-posh
has deprecated their PowerShell module and is asking users to migrate.So as a first step, run the migration steps outlined in the docs and replace
Import-Module oh-my-posh
as well asSet-PoshPrompt -Theme default
with, for example,Uncomment
so
posh-git
is enabled. Theposh-git
prompt is disabled by default:In the
posh-git
README, it says:Good, so this is what we're after: using
oh-my-posh
over theposh-git
prompt. So how do we get the latter into the former?In your
oh-my-posh.omp.json
configuration file, add a segment at a position of your choice:The relevant difference here is that this is of type
poshgit
, not of typegit
anymore (the latter being theoh-my-posh
"builtin" as far as I see).This works for me™, as a first approximation. You'll need to add custom
foreground_template
magic etc. to further customize it, but these settings should allow theposh-git
prompt to at least display from within youroh-my-posh
one.