Allows the current process to be backgrounded and then resumed.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
#include <stdio.h>
#include <errno.h>
#include <string.h>
+#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
case ctrl('C'): /* ctrl-c */
errno = EAGAIN;
return -1;
+ case ctrl('Z'): /* ctrl-z */
+#ifdef SIGTSTP
+ /* send ourselves SIGSUSP */
+ disableRawMode(current);
+ raise(SIGTSTP);
+ /* and resume */
+ enableRawMode(current);
+ refreshLine(current->prompt, current);
+#endif
+ continue;
case 127: /* backspace */
case ctrl('H'):
if (remove_char(current, current->pos - 1) == 1) {