on main help sign in
fix(paste): normalize windows newlines
bf5dd26Kieran Klukas
internal/ui/model/ui.go+3
@@ -3462,6 +3462,9 @@ func (m *UI) newSession() tea.Cmd {
3462
3462
3463// handlePasteMsg handles a paste message.
3463// handlePasteMsg handles a paste message.
3464func (m *UI) handlePasteMsg(msg tea.PasteMsg) tea.Cmd {
3464func (m *UI) handlePasteMsg(msg tea.PasteMsg) tea.Cmd {
3465+ // Normalize \r\n before the textarea sanitizer sees it.
3466+ msg.Content = strings.ReplaceAll(msg.Content, "\r\n", "\n")
3467+
3465 if m.dialog.HasDialogs() {
3468 if m.dialog.HasDialogs() {
3466 return m.handleDialogMsg(msg)
3469 return m.handleDialogMsg(msg)
3467 }
3470 }