diff -u nano/files.c nano-kill/files.c --- nano/files.c Wed Jan 29 20:23:04 2003 +++ nano-kill/files.c Fri Jan 31 04:26:01 2003 @@ -1340,7 +1340,8 @@ statusbar(_("Cancelled")); return -1; } - titlebar(NULL); + if (!tmp) + titlebar(NULL); fileptr = fileage; realname = real_dir_from_tilde(name); diff -u nano/global.c nano-kill/global.c --- nano/global.c Wed Jan 15 18:35:03 2003 +++ nano-kill/global.c Fri Jan 31 04:10:16 2003 @@ -147,6 +147,11 @@ subexpressions, max of 10 */ #endif +int curses_ended = FALSE; /* Indicates to statusbar() to simply + * write to stderr, since endwin() has + * ended curses mode. */ + + int length_of_list(const shortcut *s) { int i = 0; diff -u nano/nano.c nano-kill/nano.c --- nano/nano.c Wed Jan 29 20:22:24 2003 +++ nano-kill/nano.c Fri Jan 31 04:23:12 2003 @@ -105,14 +105,12 @@ { va_list ap; + endwin(); + curses_ended = TRUE; + /* Restore the old term settings */ tcsetattr(0, TCSANOW, &oldterm); - clear(); - refresh(); - resetty(); - endwin(); - va_start(ap, msg); vfprintf(stderr, msg, ap); va_end(ap); @@ -2784,7 +2782,7 @@ /* Handler for SIGHUP and SIGTERM */ RETSIGTYPE handle_hupterm(int signal) { - die(_("Received SIGHUP or SIGTERM")); + die(_("Received SIGHUP or SIGTERM\n")); } /* What do we do when we catch the suspend signal */ diff -u nano/proto.h nano-kill/proto.h --- nano/proto.h Wed Jan 29 20:22:24 2003 +++ nano-kill/proto.h Fri Jan 31 04:10:50 2003 @@ -115,6 +115,8 @@ extern historyheadtype replace_history; #endif +extern int curses_ended; + /* Functions we want available */ /* Public functions in color.c */ diff -u nano/winio.c nano-kill/winio.c --- nano/winio.c Wed Jan 29 16:55:48 2003 +++ nano-kill/winio.c Fri Jan 31 04:22:48 2003 @@ -1364,10 +1364,19 @@ int start_x = 0; size_t foo_len; + va_start(ap, msg); + + /* Curses mode is turned off. If we use wmove() now, it will muck up + the terminal settings. So we just use vfprintf(). */ + if (curses_ended) { + vfprintf(stderr, msg, ap); + va_end(ap); + return; + } + assert(COLS >= 4); foo = charalloc(COLS - 3); - va_start(ap, msg); vsnprintf(foo, COLS - 3, msg, ap); va_end(ap);