[PR #1133] [CLOSED] initial commit of the readline editor replacement #10478

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1133
Author: @pdevine
Created: 11/15/2023
Status: Closed

Base: mainHead: editor


📝 Commits (2)

  • 8627f6c initial commit of the readline editor replacement
  • ad83c87 add back in the windows terminal file

📊 Changes

11 files changed (+527 additions, -634 deletions)

View changed files

📝 cmd/cmd.go (+10 -30)
editor/buffer.go (+488 -0)
📝 editor/editor.go (+24 -73)
📝 editor/errors.go (+1 -1)
📝 editor/term.go (+1 -1)
📝 editor/term_bsd.go (+1 -2)
📝 editor/term_linux.go (+1 -2)
📝 editor/term_windows.go (+0 -0)
📝 editor/types.go (+1 -1)
readline/buffer.go (+0 -372)
readline/history.go (+0 -152)

📄 Description

This change is a full replacement for the current readline package that we had introduced before. It builds on that version but now properly handles multi-line input.

Some new features:

  • word wrap between lines (no more splitting lines in the middle of a word)
  • free movement of the cursor (up/down/left/right)
  • full multi-line support (no need to use """)
  • allow new lines w/ Ctrl-J (still impossible to allow this w/ shift-enter)
  • bracketed paste support (copy and paste into the editor)

There are a few things which are still broken:

  • Deleting a line doesn't (yet) clean up the buffer (although will remove the text)
  • Moving by word (i.e. forward/backward by word) isn't yet supported
  • The delete key is only single line still (although backspace will work across lines)
  • There is no "history" support yet for getting old prompts
  • I haven't yet added """ support back in, but we potentially don't need it?

🔄 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/1133 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 11/15/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `editor` --- ### 📝 Commits (2) - [`8627f6c`](https://github.com/ollama/ollama/commit/8627f6c66cb0246bb3952cf490fdf44a50edce20) initial commit of the readline editor replacement - [`ad83c87`](https://github.com/ollama/ollama/commit/ad83c87454c84f4d2fc7b2a391a4cf621a3ea971) add back in the windows terminal file ### 📊 Changes **11 files changed** (+527 additions, -634 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+10 -30) ➕ `editor/buffer.go` (+488 -0) 📝 `editor/editor.go` (+24 -73) 📝 `editor/errors.go` (+1 -1) 📝 `editor/term.go` (+1 -1) 📝 `editor/term_bsd.go` (+1 -2) 📝 `editor/term_linux.go` (+1 -2) 📝 `editor/term_windows.go` (+0 -0) 📝 `editor/types.go` (+1 -1) ➖ `readline/buffer.go` (+0 -372) ➖ `readline/history.go` (+0 -152) </details> ### 📄 Description This change is a full replacement for the current `readline` package that we had introduced before. It builds on that version but now properly handles multi-line input. Some new features: * word wrap between lines (no more splitting lines in the middle of a word) * free movement of the cursor (up/down/left/right) * full multi-line support (no need to use """) * allow new lines w/ Ctrl-J (still impossible to allow this w/ shift-enter) * bracketed paste support (copy and paste into the editor) There are a few things which are still broken: * Deleting a line doesn't (yet) clean up the buffer (although will remove the text) * Moving by word (i.e. forward/backward by word) isn't yet supported * The delete key is only single line still (although backspace will work across lines) * There is no "history" support yet for getting old prompts * I haven't yet added """ support back in, but we potentially don't need it? --- <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:01:26 -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#10478