Skip to content

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

Open
@tribals

Description

@tribals

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementIt's a feature request.Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions