Double backspace to remove part of previous command #23371

Closed
opened 2026-01-31 08:40:19 +00:00 by claunia · 3 comments
Owner

Originally created by @lexcyn on GitHub (Jun 19, 2025).

Description of the new feature

Let's say you are updating individual apps via winget in Terminal and instead of having to manually remove your last command to input a new app ID by holding backspace, you could rapidly press the backspace twice that would remove the last part of the command (separated by a space).

For example, let's say your previous command was:

winget update --id GitHub.GitHubDesktop

Pressing backspace 2x in rapid succession would remove the GitHub.GitHubDesktop part of your most recent command and allow you to enter in your new app ID easier.

Of course, this option could be configurable in settings.

Proposed technical implementation details

No response

Originally created by @lexcyn on GitHub (Jun 19, 2025). ### Description of the new feature Let's say you are updating individual apps via winget in Terminal and instead of having to manually remove your last command to input a new app ID by holding backspace, you could rapidly press the backspace twice that would remove the last part of the command (separated by a space). For example, let's say your previous command was: `winget update --id GitHub.GitHubDesktop` Pressing backspace 2x in rapid succession would remove the `GitHub.GitHubDesktop` part of your most recent command and allow you to enter in your new app ID easier. Of course, this option could be configurable in settings. ### Proposed technical implementation details _No response_
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 08:40:20 +00:00
Author
Owner

@DHowett commented on GitHub (Jun 19, 2025):

So, today, most of the shells on Windows we follow Windows line editing rules - you can delete a whole word like GitHub.GitHubDesktop using Ctrl+Backspace. Linux shells often support Ctrl+W to fill the same purpose. Do either of those work for you?

FWIW, since Terminal doesn't really know what is a word on the input line (as opposed to a word anywhere near a cursor) and there is no standard input sequence we could generate to tell the shell to delete such a word, it is unlikely that we'll be able to do anything really intelligent here. This is one case where having the shell handle it is more flexible and more reliable. 🙂

@DHowett commented on GitHub (Jun 19, 2025): So, today, most of the shells on Windows we follow Windows line editing rules - you can delete a whole word like GitHub.GitHubDesktop using <kbd>Ctrl+Backspace</kbd>. Linux shells often support <kbd>Ctrl+W</kbd> to fill the same purpose. Do either of those work for you? FWIW, since Terminal doesn't really _know_ what is a word on the input line (as opposed to a word anywhere near a cursor) and there is no standard input sequence we could generate to tell the shell to delete such a word, it is unlikely that we'll be able to do anything really intelligent here. This is one case where having the shell handle it is more flexible _and_ more reliable. 🙂
Author
Owner

@lexcyn commented on GitHub (Jun 19, 2025):

So, today, most of the shells on Windows we follow Windows line editing rules - you can delete a whole word like GitHub.GitHubDesktop using Ctrl+Backspace. Linux shells often support Ctrl+W to fill the same purpose. Do either of those work for you?

FWIW, since Terminal doesn't really know what is a word on the input line (as opposed to a word anywhere near a cursor) and there is no standard input sequence we could generate to tell the shell to delete such a word, it is unlikely that we'll be able to do anything really intelligent here. This is one case where having the shell handle it is more flexible and more reliable. 🙂

You know what, Ctrl+Backspace does work! It doesn't remove the whole string, but it is way easier than holding backspace. Thanks for the tip, I've been using Windows shell forever and did not know this existed haha. 🤓

@lexcyn commented on GitHub (Jun 19, 2025): > So, today, most of the shells on Windows we follow Windows line editing rules - you can delete a whole word like GitHub.GitHubDesktop using Ctrl+Backspace. Linux shells often support Ctrl+W to fill the same purpose. Do either of those work for you? > > FWIW, since Terminal doesn't really _know_ what is a word on the input line (as opposed to a word anywhere near a cursor) and there is no standard input sequence we could generate to tell the shell to delete such a word, it is unlikely that we'll be able to do anything really intelligent here. This is one case where having the shell handle it is more flexible _and_ more reliable. 🙂 You know what, `Ctrl+Backspace` does work! It doesn't remove the _whole_ string, but it is way easier than holding backspace. Thanks for the tip, I've been using Windows shell forever and did not know this existed haha. 🤓
Author
Owner

@DHowett commented on GitHub (Jun 19, 2025):

Oh I'm glad it worked! Thanks!

@DHowett commented on GitHub (Jun 19, 2025): Oh I'm glad it worked! Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23371