Skip to content

ClearScreen should clear scrollback buffer as well, or PSReadLine should implement ClearDisplay #4626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
tribals opened this issue Mar 10, 2025 · 1 comment
Labels
Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@tribals
Copy link

tribals commented Mar 10, 2025

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

The GNU readline has clear-display command since version 8.1, about four years.

clear-display (M-C-l)

Clear the screen and, if possible, the terminal’s scrollback buffer, then redraw the current line, leaving the current line at the top of the screen.

clear-screen (C-l)

Clear the screen, then redraw the current line, leaving the current line at the top of the screen.

Clearing only screen without scrollback is rather useless, as it is garbled with old junk from previous commands.

There is a question on Super User, with answer suggesting to rebind Ctrl-L to a script executing cls command. This is very inefficient, if not say more.

So, PSReadLine ClearScreen should clear scrollback too, or it should implement ClearDisplay as well.

Proposed technical implementation details (optional)

Please don't do it the way libvte does - there is no excuse for them to do it that way.

@tribals tribals added the Issue-Enhancement It's a feature request. label Mar 10, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

2 participants
@tribals and others