I'm trying to use a /bin/sh script to scroll down a couple of lines of text in terminal. A solution using smcup, rmcup is not acceptable in this case.
A couple of other options I tried all failed (includes correction from JdeBP):
tput cup 0 0; tput ri
tput cup 0 0; tput rin 3
This is a bit weird because man terminfo specifies:
To scroll text down, a program goes to the top left corner of the screen and sends the ri (reverse index) string. The strings ind and ri are undefined when not on their respective corners of the screen.
The output of terminal has to be scrollable before running any tests (try using set, env prior to tests).
A solution for xterm will suffice.
To speed up tests and clarify use this script to start:
#!/bin/sh # create scrollable text set # includes correction from JdeBP # try to scroll text down one line tput cup 0 0; tput ri # includes correction from JdeBP # try to scroll text down 3 lines tput cup 0 0; tput rin 3