If para_gui is signalled in external mode, and the running program
has set the mouse mask to receive mouse events, mouse buttons
(copy and paste) might not work after para_gui exits. This has
been observed at least with xterm and aumix as the external program.
Setting an all-one mask seems to cure the problem.
{
va_list argp;
+ /* mousemask() exists only in ncurses */
+#ifdef NCURSES_MOUSE_VERSION
+ mousemask(~(mmask_t)0, NULL); /* Avoid bad terminal state with xterm. */
+#endif
shutdown_curses();
va_start(argp, fmt);
vfprintf(stderr, fmt, argp);