- Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D].
main()
- Code to silently process "-g" and "-j" (Rocco)
+ signal_init()
+ - Reorder sigaction calls, use sigfillset() to stop SIGTSTP and
+ SIGCONT from being interrupted, allows suspending nano
+ to work more reliably, esp. with mutt, etc.
+ do_suspend()
+ - 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.
+ do_cont()
+ - Now just does a refresh call instead of playing with the SIGTSTP
+ handler.
- nano.h:
- Updated the BROWSER_LIST_LEN for the "Goto Directory" code (Rocco)
- proto.h:
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
-EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html nanorc.sample
+EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html nanorc.sample
SUBDIRS = po intl
NROFF = nroff
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
-INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \
+INSTALL Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \
config.guess config.h.in config.sub configure configure.in install-sh \
missing mkinstalldirs texinfo.tex
/* What do we do when we catch the suspend signal */
RETSIGTYPE do_suspend(int signal)
{
-
- act.sa_handler = SIG_DFL;
- sigemptyset(&act.sa_mask);
- sigaction(SIGTSTP, &act, NULL);
-
endwin();
- fprintf(stderr, "\n\n\n\n\nUse \"fg\" to return to nano\n");
- raise(SIGTSTP);
+ printf("\n\n\n\n\nUse \"fg\" to return to nano\n");
+ fflush(stdout);
+
+ /* We used to re-enable the default SIG_DFL and raise SIGTSTP, but
+ then we could be (and were) interrupted in the middle of the call.
+ So we do it the mutt way instead */
+ kill(0, SIGSTOP);
}
/* Restore the suspend handler when we come back into the prog */
RETSIGTYPE do_cont(int signal)
{
- act.sa_handler = do_suspend;
- sigemptyset(&act.sa_mask);
- sigaction(SIGTSTP, &act, NULL);
- initscr();
- total_refresh();
+ /* Now we just update the screen instead of having to reenable the
+ SIGTSTP handler */
+
+ wnoutrefresh(edit);
+ wnoutrefresh(bottomwin);
+ wnoutrefresh(topwin);
+ doupdate();
}
void handle_sigwinch(int s)
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
+ /* Trap SIGHUP cuz we want to write the file out. */
+ act.sa_handler = handle_hup;
+ sigaction(SIGHUP, &act, NULL);
+
+ act.sa_handler = handle_sigwinch;
+ sigaction(SIGWINCH, &act, NULL);
+
if (!ISSET(SUSPEND)) {
sigaction(SIGTSTP, &act, NULL);
} else {
+ /* if we don't do this, it seems other stuff interrupts the
+ suspend handler! Try using nano with mutt without this line */
+ sigfillset(&act.sa_mask);
+
act.sa_handler = do_suspend;
sigaction(SIGTSTP, &act, NULL);
sigaction(SIGCONT, &act, NULL);
}
-
- /* Trap SIGHUP cuz we want to write the file out. */
- act.sa_handler = handle_hup;
- sigaction(SIGHUP, &act, NULL);
-
- act.sa_handler = handle_sigwinch;
- sigaction(SIGWINCH, &act, NULL);
-
}
void window_init(void)