mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
fix(engine): render a non-empty tooltip only
This commit is contained in:
parent
6f99041ad9
commit
9c5cc42622
|
@ -253,10 +253,16 @@ func (e *Engine) PrintTooltip(tip string) string {
|
||||||
switch e.Env.Shell() {
|
switch e.Env.Shell() {
|
||||||
case shell.ZSH, shell.CMD, shell.FISH:
|
case shell.ZSH, shell.CMD, shell.FISH:
|
||||||
block.Init(e.Env, e.Writer, e.Ansi)
|
block.Init(e.Env, e.Writer, e.Ansi)
|
||||||
|
if !block.Enabled() {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
text, _ := block.RenderSegments()
|
text, _ := block.RenderSegments()
|
||||||
return text
|
return text
|
||||||
case shell.PWSH, shell.PWSH5:
|
case shell.PWSH, shell.PWSH5:
|
||||||
block.InitPlain(e.Env, e.Config)
|
block.InitPlain(e.Env, e.Config)
|
||||||
|
if !block.Enabled() {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
text, length := block.RenderSegments()
|
text, length := block.RenderSegments()
|
||||||
e.write(e.Ansi.ClearAfter())
|
e.write(e.Ansi.ClearAfter())
|
||||||
e.write(e.Ansi.CarriageForward())
|
e.write(e.Ansi.CarriageForward())
|
||||||
|
@ -264,7 +270,7 @@ func (e *Engine) PrintTooltip(tip string) string {
|
||||||
e.write(text)
|
e.write(text)
|
||||||
return e.string()
|
return e.string()
|
||||||
}
|
}
|
||||||
return " "
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtraPromptType int
|
type ExtraPromptType int
|
||||||
|
|
Loading…
Reference in a new issue