Lua primitives: exec()
The exec function will reset the screen to allow you to run an interactive program without seeing any garbled display artifacts.
You might use it as follows:
exec( "top" );
When the program terminates the screen will be reset, and the current display restored.
This function has been available since version 0.07.