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.
This commit is contained in:
Ayman Bagabas
2025-07-17 10:08:49 -04:00
parent fe0f4bbcb1
commit a236ede84d

View File

@@ -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")