This is easy to do by masking the SIGTSTP signal:
#include <signal.h>
signal(SIGTSTP,SIG_IGN);
What nano does is apparently.
If you want nano to allow you to pause it with ctrl-z, you can put the line:
allow nano to suspend
c $HOME/.nanorc.
source
share