Skip to content
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

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

Closed
vefatica opened this issue May 24, 2024 · 2 comments
Closed

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

vefatica opened this issue May 24, 2024 · 2 comments
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@vefatica
Copy link

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.

@microsoft-github-policy-service microsoft-github-policy-service bot added 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 labels May 24, 2024
@j4james
Copy link
Collaborator

j4james commented May 25, 2024

What you're trying to do should ideally work, and we've already got an issue tracking that (#11078). But even if it were fixed on Windows Terminal, using SU this way is not generally reliable, so it's not something I would recommend.

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

The most reliable solution is just writing out a bunch of LF characters at the bottom of the screen.

@vefatica
Copy link
Author

I see. Thanks for the suggestion, @j4james. It works nicely. I should have thought of it. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants