diff --git a/src/prompt/engine.go b/src/prompt/engine.go index ba9d34a5111a..234974e14cc6 100644 --- a/src/prompt/engine.go +++ b/src/prompt/engine.go @@ -166,6 +166,13 @@ func (e *Engine) getTitleTemplateText() string { } func (e *Engine) renderBlock(block *config.Block, cancelNewline bool) bool { + text, length := e.writeBlockSegments(block) + + // do not print anything when we don't have any text + if length == 0 { + return false + } + defer e.applyPowerShellBleedPatch() // do not print a newline to avoid a leading space @@ -175,13 +182,6 @@ func (e *Engine) renderBlock(block *config.Block, cancelNewline bool) bool { e.writeNewline() } - text, length := e.writeBlockSegments(block) - - // do not print anything when we don't have any text - if length == 0 { - return false - } - switch block.Type { case config.Prompt: if block.Alignment == config.Left {