Skip to content

Question: Scroll text up to a clear screen? #13412

Answered by DHowett
vefatica asked this question in Q&A
Discussion options

You must be logged in to vote

I think your best bet would be to mimic what the clear command does on Linux:

Send \e[2J\e[H.

  1. \e[2J is ED or Erase in Display, above and below the cursor
  2. \e[H to home the cursor at the top left

Most popular terminals these days have settled on ED pushing the screen into the scrollback, so this is the most broadly compatible option!

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@DHowett
Comment options

Answer selected by DHowett
Comment options

You must be logged in to vote
1 reply
@DHowett
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements
2 participants
Converted from issue

This discussion was converted from issue #13411 on July 01, 2022 04:18.