diff --git a/Sources/TUIKit/App/App.swift b/Sources/TUIKit/App/App.swift index c3f5a88..404b664 100644 --- a/Sources/TUIKit/App/App.swift +++ b/Sources/TUIKit/App/App.swift @@ -555,7 +555,10 @@ internal final class AppRunner { let visibleWidth = line.strippedLength let padding = max(0, terminalWidth - visibleWidth) - let paddedLine = bgCode + line + String(repeating: " ", count: padding) + reset + + // Replace all reset codes with "reset + restore background" + let lineWithBg = line.replacingOccurrences(of: reset, with: reset + bgCode) + let paddedLine = bgCode + lineWithBg + String(repeating: " ", count: padding) + reset terminal.write(paddedLine) } } @@ -643,7 +646,7 @@ extension WindowGroup: SceneRenderable { let bgCode = ANSIRenderer.backgroundCode(for: bgColor) let reset = ANSIRenderer.reset - // Write buffer to terminal, wrapping each line with background color + // Write buffer to terminal, ensuring consistent background color for row in 0..