Skip to content

Is SU (ESC[<n>S) supposed to erase text? #17320

Closed
@vefatica

Description

@vefatica

I ultimately want to scroll so that the current command line is at the top of the viewport. I thought I could do that with some combination of SU and cursor placement. Not worrying about cursor placement, I noticed this.

Having just executed DIR I'm at the bottom (line 42) of the viewport.

image

If I issue echo ^e[37S 37 lines of the history (now out of the viewport) are erased. And it's NOT the last 37 lines that were erased! Here's the tail end of what's now in the history.

image

In contrast, if, in the same situation, I issue echo ^e[35S nothing is erased.

What's going on there? The docs don't mention SU erasing anything (especially in such an odd way). And it would be useful to scroll without losing any recent history.

Is there another strategy for scrolling, without losing anything, so the current command line is at the top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions