From a236ede84d644023fd4eb5a79b78e485ee2c81ea Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 17 Jul 2025 10:08:49 -0400 Subject: [PATCH] fix(tui): renderer: replace tabs with spaces in plain content We need to ensure that tabs in plain text content are replaced with spaces otherwise they will be escaped and displayed as tab unicode picture characters. --- internal/tui/components/chat/messages/renderer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/tui/components/chat/messages/renderer.go b/internal/tui/components/chat/messages/renderer.go index 162b98aec2da8fd2b98ae9c46ebc64cb9effec8e..053870476f5a47d67eb827bbc4143c619049f13f 100644 --- a/internal/tui/components/chat/messages/renderer.go +++ b/internal/tui/components/chat/messages/renderer.go @@ -656,6 +656,7 @@ func joinHeaderBody(header, body string) string { func renderPlainContent(v *toolCallCmp, content string) string { t := styles.CurrentTheme() content = strings.ReplaceAll(content, "\r\n", "\n") // Normalize line endings + content = strings.ReplaceAll(content, "\t", " ") // Replace tabs with spaces content = strings.TrimSpace(content) lines := strings.Split(content, "\n")