How to get an overlay output for a command in terminal like less or man?

Viewed 346

Some of the linux commands like less or man display their output in the current terminal occupying the whole screen. But the previous interactions reappear as is once the program quits.

How can we achieve the same behavior for our custom program?

Thank you.

1 Answers
Related