Skip to content

ED3 in the alt buffer should erase the main scrollback buffer #3686

@j4james

Description

@j4james

Environment

Windows build number: Version 10.0.18362.356
Also tested with a recent build from source: 171f00c

Steps to reproduce

  1. Start a WSL bash shell in conhost.
  2. Do a long directory listing so you get some content in the backscroll buffer.
  3. Execute this command: printf "\e[?1049h\e[3J\e[?1049l"

That command switches to the alternate buffer (private mode 1049), executes the ED escape sequence with parameter 3 (i.e. erase the scrollback buffer), and then switches back to the main buffer.

Expected behavior

The alternate screen buffer doesn't have a scrollback, so the ED3 sequence should erase the main scrollback buffer. Then when you switch back to the main screen, there should be no scrollback any more.

This is how the command is implemented in XTerm, and most of the other terminal emulators I've tested.

Actual behavior

The main scrollback buffer isn't erased.

This is probably somewhat related to issue #3545. I think the alt screen technically has its own scrollback (even though it's zero length), and it's that empty buffer that is being "erased" when ED3 is executed. It might be better if the alt screen shared the same buffer as the main screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-ConhostFor issues in the Console codebase

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions