mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
28e11bdabd
commit
42b75241c7
|
@ -232,13 +232,6 @@ func (w *Writer) ConsolePwd(pwdType, userName, hostName, pwd string) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Writer) ClearAfter() string {
|
|
||||||
if w.Plain {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return w.clearLine + w.clearBelow
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *Writer) FormatTitle(title string) string {
|
func (w *Writer) FormatTitle(title string) string {
|
||||||
title = w.trimAnsi(title)
|
title = w.trimAnsi(title)
|
||||||
if w.Plain {
|
if w.Plain {
|
||||||
|
|
|
@ -153,10 +153,6 @@ func (e *Engine) getTitleTemplateText() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Engine) renderBlock(block *Block, cancelNewline bool) {
|
func (e *Engine) renderBlock(block *Block, cancelNewline bool) {
|
||||||
defer func() {
|
|
||||||
e.write(e.Writer.ClearAfter())
|
|
||||||
}()
|
|
||||||
|
|
||||||
// when in bash, for rprompt blocks we need to write plain
|
// when in bash, for rprompt blocks we need to write plain
|
||||||
// and wrap in escaped mode or the prompt will not render correctly
|
// and wrap in escaped mode or the prompt will not render correctly
|
||||||
if e.Env.Shell() == shell.BASH && block.Type == RPrompt {
|
if e.Env.Shell() == shell.BASH && block.Type == RPrompt {
|
||||||
|
@ -374,7 +370,6 @@ func (e *Engine) PrintTooltip(tip string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
text, length := block.RenderSegments()
|
text, length := block.RenderSegments()
|
||||||
e.write(e.Writer.ClearAfter())
|
|
||||||
e.write(e.Writer.CarriageForward())
|
e.write(e.Writer.CarriageForward())
|
||||||
e.write(e.Writer.GetCursorForRightWrite(length, 0))
|
e.write(e.Writer.GetCursorForRightWrite(length, 0))
|
||||||
e.write(text)
|
e.write(text)
|
||||||
|
|
Loading…
Reference in a new issue