mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 12:29:40 -08:00
parent
502c346d9b
commit
9cd20f2764
|
@ -159,7 +159,7 @@ func (e *Engine) renderBlock(block *Block) {
|
||||||
}()
|
}()
|
||||||
// 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 || block.Alignment == Right) {
|
if e.Env.Shell() == shell.BASH && block.Type == RPrompt {
|
||||||
block.InitPlain(e.Env, e.Config)
|
block.InitPlain(e.Env, e.Config)
|
||||||
} else {
|
} else {
|
||||||
block.Init(e.Env, e.Writer)
|
block.Init(e.Env, e.Writer)
|
||||||
|
@ -214,18 +214,10 @@ func (e *Engine) renderBlock(block *Block) {
|
||||||
e.write(text)
|
e.write(text)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// this can contain ANSI escape sequences
|
prompt := e.Writer.CarriageForward()
|
||||||
writer := e.Writer
|
prompt += e.Writer.GetCursorForRightWrite(length, block.HorizontalOffset)
|
||||||
if e.Env.Shell() == shell.BASH {
|
|
||||||
writer.Init(shell.GENERIC)
|
|
||||||
}
|
|
||||||
prompt := writer.CarriageForward()
|
|
||||||
prompt += writer.GetCursorForRightWrite(length, block.HorizontalOffset)
|
|
||||||
prompt += text
|
prompt += text
|
||||||
e.currentLineLength = 0
|
e.currentLineLength = 0
|
||||||
if e.Env.Shell() == shell.BASH {
|
|
||||||
prompt = e.Writer.FormatText(prompt)
|
|
||||||
}
|
|
||||||
e.write(prompt)
|
e.write(prompt)
|
||||||
case RPrompt:
|
case RPrompt:
|
||||||
e.rprompt, e.rpromptLength = block.RenderSegments()
|
e.rprompt, e.rpromptLength = block.RenderSegments()
|
||||||
|
|
Loading…
Reference in a new issue