[GH-ISSUE #4534] Ctrl+Backspace doesn't delete full words in ollama run ... mode #2844

Closed
opened 2026-04-12 13:11:12 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @DeflateAwning on GitHub (May 20, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4534

Originally assigned to: @joshyan1 on GitHub.

What is the issue?

In ollama run <model> mode, pressing Ctrl+Backspace should delete a whole word backwards.

To implement this, "listen" for "Ctrl+H" presses (as that's what Ctrl+Backspace is sent as)

OS

Linux

GPU

No response

CPU

No response

Ollama version

0.1.38

Originally created by @DeflateAwning on GitHub (May 20, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4534 Originally assigned to: @joshyan1 on GitHub. ### What is the issue? In `ollama run <model>` mode, pressing Ctrl+Backspace should delete a whole word backwards. To implement this, "listen" for "Ctrl+H" presses (as that's what Ctrl+Backspace is sent as) ### OS Linux ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.1.38
GiteaMirror added the bug label 2026-04-12 13:11:12 -05:00
Author
Owner

@joshyan1 commented on GitHub (May 22, 2024):

Hey @DeflateAwning, Ctrl + Backspace (Ctrl + H) maps to just Backspace in Ollama. If you want to delete the previous word, please use Ctrl + W which should already implemented. I've added documentation of the shortcut in /? shortcuts

<!-- gh-comment-id:2123614795 --> @joshyan1 commented on GitHub (May 22, 2024): Hey @DeflateAwning, Ctrl + Backspace (Ctrl + H) maps to just Backspace in Ollama. If you want to delete the previous word, please use Ctrl + W which should already implemented. I've added documentation of the shortcut in /? shortcuts
Author
Owner

@DeflateAwning commented on GitHub (May 22, 2024):

Makes sense, thanks! Any reason not to have both act as a backspace?

<!-- gh-comment-id:2123619382 --> @DeflateAwning commented on GitHub (May 22, 2024): Makes sense, thanks! Any reason not to have both act as a backspace?
Author
Owner

@joshyan1 commented on GitHub (May 22, 2024):

Sorry, can you clarify which two you're referring to? Currently Ctrl + W removes the previous word and Ctrl + H is a backspace. As you said, Ctrl + Backspace is received as Ctrl + H so Ctrl + Backspace is simply a backspace as well.

<!-- gh-comment-id:2123624371 --> @joshyan1 commented on GitHub (May 22, 2024): Sorry, can you clarify which two you're referring to? Currently Ctrl + W removes the previous word and Ctrl + H is a backspace. As you said, Ctrl + Backspace is received as Ctrl + H so Ctrl + Backspace is simply a backspace as well.
Author
Owner

@DeflateAwning commented on GitHub (May 22, 2024):

Ctrl+H gets sent when you press Ctrl+Backspace in most terminals (at least in my experience). Ctrl+Backspace (which is sent as Ctrl+H) should remove an entire word (to be compliant with every other software and OS out there).

<!-- gh-comment-id:2123776212 --> @DeflateAwning commented on GitHub (May 22, 2024): Ctrl+H gets sent when you press Ctrl+Backspace in most terminals (at least in my experience). Ctrl+Backspace (which is sent as Ctrl+H) should remove an entire word (to be compliant with every other software and OS out there).
Author
Owner

@joshyan1 commented on GitHub (May 22, 2024):

Thanks for the feedback. Ctrl + W is generally used in terminal based applications for this shortcut so we've decided to use it as well.

<!-- gh-comment-id:2123921058 --> @joshyan1 commented on GitHub (May 22, 2024): Thanks for the feedback. Ctrl + W is generally used in terminal based applications for this shortcut so we've decided to use it as well.
Author
Owner

@pdevine commented on GitHub (May 22, 2024):

I'm sorta torn here because generally speaking Ctrl-H is backspace. Ctrl-Backspace will do a Ctrl-W in most desktop programs, but it doesn't do that in my terminal and just maps to Ctrl-H by default.

<!-- gh-comment-id:2125947670 --> @pdevine commented on GitHub (May 22, 2024): I'm sorta torn here because generally speaking Ctrl-H is backspace. Ctrl-Backspace will do a Ctrl-W in most desktop programs, but it doesn't do that in my terminal and just maps to Ctrl-H by default.
Author
Owner

@DeflateAwning commented on GitHub (May 22, 2024):

Hmm, have never seen that behaviour, but have also not really done any low-level key handling outside of terminals and terminal UIs.

<!-- gh-comment-id:2125949396 --> @DeflateAwning commented on GitHub (May 22, 2024): Hmm, have never seen that behaviour, but have also not really done any low-level key handling outside of terminals and terminal UIs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2844