- Don't try to play with the handler inside the handler. Just
raise a SIGSTOP. We also now write the "use "fg"" message to
stdout instead of stderr.
+ - Added _POSIX_VDISABLE macro to fully ignore suspend keystroke.
+ Eliminates the possibility that nano can be suspended when
+ it's not supposed to be. Many many many thanks to Jordi and
+ Tom Lear for helping out finding and fixing this bug!
do_cont()
- Now just does a refresh call instead of playing with the SIGTSTP
handler.
void signal_init(void)
{
+#ifdef _POSIX_VDISABLE
+ struct termios term;
+#endif
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
sigaction(SIGWINCH, &act, NULL);
if (!ISSET(SUSPEND)) {
+
+/* Insane! */
+#ifdef _POSIX_VDISABLE
+ tcgetattr(0, &term);
+ term.c_cc[VSUSP] = _POSIX_VDISABLE;
+ tcsetattr(0, TCSANOW, &term);
+#else
+ act.sa_handler = SIG_IGN;
sigaction(SIGTSTP, &act, NULL);
+#endif
+
} else {
/* if we don't do this, it seems other stuff interrupts the
suspend handler! Try using nano with mutt without this line */