[PR #3043] [MERGED] Fix paste of text with line feed characters #11042

Closed
opened 2026-04-12 23:19:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3043
Author: @glumia
Created: 3/10/2024
Status: Merged
Merged: 5/7/2024
Merged by: @jmorganca

Base: mainHead: main


📝 Commits (1)

  • 239e8b7 Fix paste of text with line feed characters

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 readline/readline.go (+2 -2)

📄 Description

Hey there, thanks for this awesome tool 🙌

This is a small patch to fix copy-paste with some terminals that send line feed characters when pasting text with newlines.

To test these changes, run ollama in interactive mode on Kitty and paste:

text
on multiple
lines

Curiously this issue doesn't occur on MacOS's default terminal, because it sends CR characters for the newlines. I'm not sure which terminal behavior is the correct one, anyway I figured it would make sense for ollama to support CR and LF characters in the same way.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/3043 **Author:** [@glumia](https://github.com/glumia) **Created:** 3/10/2024 **Status:** ✅ Merged **Merged:** 5/7/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`239e8b7`](https://github.com/ollama/ollama/commit/239e8b75279d31fb21b1267f7ea45e5e4d0348e5) Fix paste of text with line feed characters ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `readline/readline.go` (+2 -2) </details> ### 📄 Description Hey there, thanks for this awesome tool 🙌 This is a small patch to fix copy-paste with some terminals that send line feed characters when pasting text with newlines. To test these changes, run ollama in interactive mode on [Kitty](https://github.com/kovidgoyal/kitty) and paste: ```txt text on multiple lines ``` Curiously this issue doesn't occur on MacOS's default terminal, because it sends CR characters for the newlines. I'm not sure which terminal behavior is the correct one, anyway I figured it would make sense for ollama to support CR and LF characters in the same way. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:19:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#11042