Availability:C-language interface function
void * PL_save_ctty()Prepare for running a child process on the terminal of the calling
thread's user_input, user_output and user_error
when that terminal is not the controlling terminal of our session, such
as the pty of an Epilog window. A child that makes such a terminal its
controlling terminal is the leader of its session, and BSD kernels,
including MacOS, revoke the terminal when that leader exits, leaving
Prolog's descriptors on it unusable. Call this before creating the child
and pass the result to PL_restore_ctty()
after the child has been reaped. Returns NULL if there is
nothing to restore, notably when running on the controlling terminal and
on systems that do not revoke. The returned state holds resources and
must always be passed to PL_restore_ctty().
Used by shell/1
and process_create/3.