Add suport for deleting large amounts of text #16697

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

Originally created by @Josh65-2201 on GitHub (Feb 7, 2022).

Description of the new feature/enhancement

If i selected text then press backspace it will unselect text and then remove the last charater as if nothing was selected.

Proposed technical implementation details (optional)

When a selection is made and backspace or delete is press it should remove the selected text

Originally created by @Josh65-2201 on GitHub (Feb 7, 2022). # Description of the new feature/enhancement If i selected text then press backspace it will unselect text and then remove the last charater as if nothing was selected. # Proposed technical implementation details (optional) When a selection is made and backspace or delete is press it should remove the selected text
Author
Owner

@zadjii-msft commented on GitHub (Feb 7, 2022):

That's not really how terminals work. They're basically write-only grids of characters, and it's the responsibility of the commandline application (cmd, powershell, bash, zsh, vi, emacs, etc) to fill that buffer with text (or in this case, remove the text from the screen). So this is something that vim or emacs would need to support (and likely already do) via something like mouse mode.

@zadjii-msft commented on GitHub (Feb 7, 2022): That's not really how terminals work. They're basically write-only grids of characters, and it's the responsibility of the commandline application (`cmd`, `powershell`, `bash`, `zsh`, `vi`, `emacs`, etc) to fill that buffer with text (or in this case, remove the text from the screen). So this is something that vim or emacs would need to support (and likely already do) via something like mouse mode.
Author
Owner

@Josh65-2201 commented on GitHub (Feb 7, 2022):

Im not talking about script or terminal entered text. Im talking about the text the the user enters.

@Josh65-2201 commented on GitHub (Feb 7, 2022): Im not talking about script or terminal entered text. Im talking about the text the the user enters.
Author
Owner

@zadjii-msft commented on GitHub (Feb 8, 2022):

This is one of those things that seems like it should be easy, but alas is actually quite complicated. The terminal maintains the selection region, seperately from the shell that maintains the prompt (& input line). To make this work, that would require the shell (cmd.exe etc) to listen for mouse events to determine when the mouse was clicked & dragged in the buffer, know where its current prompt line is, and maintain its own selection.

There's a lot of discussion on this topic in #8573

@zadjii-msft commented on GitHub (Feb 8, 2022): This is one of those things that seems like it should be easy, but alas is actually quite complicated. The _terminal_ maintains the selection region, seperately from the shell that maintains the prompt (& input line). To make this work, that would require the shell (`cmd.exe` etc) to listen for mouse events to determine when the mouse was clicked & dragged in the buffer, know where its current prompt line is, and maintain its own selection. There's a lot of discussion on this topic in #8573
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16697