diff --git a/src/engine/block.go b/src/engine/block.go index 84bd4738..a8c4fbde 100644 --- a/src/engine/block.go +++ b/src/engine/block.go @@ -129,14 +129,18 @@ func (b *Block) RenderSegments() (string, int) { if !segment.Enabled && segment.style() != Accordion { continue } + if colors, newCycle := cycle.Loop(); colors != nil { cycle = &newCycle segment.colors = colors } + b.setActiveSegment(segment) b.renderActiveSegment() } + b.writeSeparator(true) + return b.writer.String() } diff --git a/src/engine/engine.go b/src/engine/engine.go index 73d93f61..e51bb712 100644 --- a/src/engine/engine.go +++ b/src/engine/engine.go @@ -222,6 +222,14 @@ func (e *Engine) renderBlock(block *Block, cancelNewline bool) bool { return false } + // in ZSH, RPROMPT is printed with a trailing space + // to ensure alignment, we need to print a space here + // see https://github.com/JanDeDobbeleer/oh-my-posh/issues/4327 + if e.Env.Shell() == shell.ZSH { + text += " " + length++ + } + space, OK := e.canWriteRightBlock(false) // we can't print the right block as there's not enough room available if !OK {