diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index 62b82a0bba9eafd41cdfc76ad23228e75f51a24f..fbc0eca985c71373e3a26a0008287437e203e759 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -3462,6 +3462,9 @@ func (m *UI) newSession() tea.Cmd { // handlePasteMsg handles a paste message. func (m *UI) handlePasteMsg(msg tea.PasteMsg) tea.Cmd { + // Normalize \r\n before the textarea sanitizer sees it. + msg.Content = strings.ReplaceAll(msg.Content, "\r\n", "\n") + if m.dialog.HasDialogs() { return m.handleDialogMsg(msg) }