Clear buffer contents when program still running (no prompt available for cls) #7275

Open
opened 2026-01-31 00:59:47 +00:00 by claunia · 0 comments
Owner

Originally created by @parml on GitHub (Apr 4, 2020).

Description of the new feature/enhancement

Implement a shortcut to clear the contents of the buffer, no matter what the underlying shell is.
This is request pertains to running programs, where the prompt is not available. The participants of #2832 address the subject in detail, however for screens where the prompt is available.

Use case:

Having a program that generates a lot of text, it is useful to mark a starting point to see what's happened starting with this point (say the logging produced by the next request to the server running in the console).
Bash allows newlines to be inserted for that purpose.
CMD and PowerShell do not allow for that.
Without any way to introduce spacing one won't know which lines are due to last request to server and which are from earlier requests (there is no access to the prompt to run cls either).
To overcome this, one must rely on timestamps and do unnecessary research.

Proposed technical implementation details (optional)

This feature request is not about doing any change in PowerShell or CMD.

Without touching any shell funcionality, the terminal could offer a cleanup operation of its own.

An analogy: iTerm2 for macOS -- on pressing ⌘K iTerm2 really clears the buffer (it's not just printing as many newlines as to obtain a clear screen, it really throws everything away, which is highly desired and the shells never offer).

This feature request is about providing functionality for clearing the contents of the buffer of the current session.
Please note that if Far Manager is open, the request is probably best ignored. (e.g. iTerm2 does not do anything on ⌘K Midnight Commander or other ncurses apps are running).

Originally created by @parml on GitHub (Apr 4, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Implement a shortcut to clear the contents of the buffer, no matter what the underlying shell is. This is request pertains to running programs, where the prompt is not available. The participants of #2832 address the subject in detail, however for screens where the prompt is available. ### Use case: Having a program that generates a lot of text, it is useful to mark a starting point to see what's happened starting with this point (say the logging produced by the next request to the server running in the console). Bash allows newlines to be inserted for that purpose. CMD and PowerShell do not allow for that. Without any way to introduce spacing one won't know which lines are due to last request to server and which are from earlier requests (there is no access to the prompt to run `cls` either). To overcome this, one must rely on timestamps and do unnecessary research. # Proposed technical implementation details (optional) This feature request is not about doing any change in PowerShell or CMD. Without touching any shell funcionality, the terminal could offer a cleanup operation of its own. An analogy: iTerm2 for macOS -- on pressing ⌘K iTerm2 really clears the buffer (it's not just printing as many newlines as to obtain a clear screen, it really throws everything away, which is highly desired and the shells never offer). This feature request is about providing functionality for clearing the contents of the buffer of the current session. Please note that if Far Manager is open, the request is probably best ignored. (e.g. iTerm2 does not do anything on ⌘K Midnight Commander or other ncurses apps are running).
claunia added the Needs-TriageResolution-Duplicate labels 2026-01-31 00:59:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7275