Is there a terminal command to keep apps from quitting? In macOS Terminal.app how can I issue a command similar to caffeinate that keeps all running applications from quitting?

In my System Preferences I have Energy Saver to: computer sleep-never and Display sleep-never, I even have caffeinate issued in the terminal.

After a while of no keyboard or mouse activity the screen will go to login mode. All apps like Excel and Mail have quit except those that required a save.

Even Terminal is asking if I really want to quit. I want all to be as if I were touching my keyboard every few minutes so not even the login screen shows and Excel never quits.
You can use the screen terminal window manager and its detach feature. This command is installed by default on OS X.

Example scenario.


Open a terminal
Run screen
Run a program of your choice e.g. htop.  
Suspend this program (Ctrl+z) and run it in background bg
Detach your current session (Ctrl+a d)
Exit your session and exit the terminal
Open the terminal again
List running session with screen -ls
Go back to your session with screen -r &lt;session id&gt;
Use your program again with fg