Description
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.
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.
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.