-
In tcsh or bash, in WT or in a console, Ctrl-L scrolls text upwards so that the current command line (even one in progress) is at the top of the viewport ... without clobbering any previous output. I'd like to implement this in TCC (where plugins may have an input keystroke handler}. I've tried the scroll sequence (ESC[nS) but that clobbers whatever previous output is currently in the viewport. How do tcsh and bash do that? Any tips would be appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I think your best bet would be to mimic what the Send
Most popular terminals these days have settled on ED pushing the screen into the scrollback, so this is the most broadly compatible option! |
Beta Was this translation helpful? Give feedback.
-
As I read the docs, ESC[2J will "Replace all text in the current viewport/screen specified by with space characters". Won't that wipe out anything that's already in the viewport? |
Beta Was this translation helpful? Give feedback.
-
P.S. How do I navigate to discussions? Edit: Never mind. That's easy enough. |
Beta Was this translation helpful? Give feedback.
-
Hmmm! I see it does do that. Maybe the docs could reflect the actual behavior. And this one which mentions only scrolling (panning) clobbers previous outout. Below is before and after panning the viewport down (and scrolling the text up a little to see what's been clobbered). _ROW is the row of the current command_line_in_progress and I'm moving the cursor too (which is necessary). If that's correct behavior, the docs could use a little work there also. |
Beta Was this translation helpful? Give feedback.
I think your best bet would be to mimic what the
clear
command does on Linux:Send
\e[2J\e[H
.\e[2J
isED
or Erase in Display, above and below the cursor\e[H
to home the cursor at the top leftMost popular terminals these days have settled on ED pushing the screen into the scrollback, so this is the most broadly compatible option!