fix(tui): preserve newlines in user messages by bypassing glamour

This commit is contained in:
Luxferre
2026-03-22 18:51:40 +02:00
parent 7e7729457a
commit d06ad6263a
+8
View File
@@ -220,6 +220,14 @@ func (m model) renderMessage(msg sidekick.Message) string {
content := msg.Content content := msg.Content
reasoning := msg.Reasoning reasoning := msg.Reasoning
// Handle user message specifically to preserve newlines
if msg.Role == sidekick.MessageRoleUser {
if m.width > 4 {
content = lipgloss.NewStyle().Width(m.width - 4).Render(content)
}
return label + "\n" + content
}
// If this is the banner message, handle it specially to preserve ASCII art // If this is the banner message, handle it specially to preserve ASCII art
if strings.Contains(content, "----") && msg.Role == sidekick.MessageRoleSystem { if strings.Contains(content, "----") && msg.Role == sidekick.MessageRoleSystem {
if strings.HasPrefix(content, banner) { if strings.HasPrefix(content, banner) {