X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=tack%2Finit.c;h=4df9d4e2d1c4450d173883fcc83573a1aa01408d;hp=4255452606da64414ab146c748b523e29a215058;hb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;hpb=b1f61d9f3aa244512045a6b02e759825d7049d34 diff --git a/tack/init.c b/tack/init.c index 42554526..4df9d4e2 100644 --- a/tack/init.c +++ b/tack/init.c @@ -15,14 +15,14 @@ ** ** You should have received a copy of the GNU General Public License ** along with TACK; see the file COPYING. If not, write to -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -** Boston, MA 02111-1307, USA. +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +** Boston, MA 02110-1301, USA */ /* initialization and wrapup code */ #include -MODULE_ID("$Id: init.c,v 1.2 2000/05/13 19:58:48 Daniel.Weaver Exp $") +MODULE_ID("$Id: init.c,v 1.6 2005/09/17 19:49:16 tom Exp $") #if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219 #define _nc_get_curterm(p) _nc_get_tty_mode(p) @@ -163,10 +163,18 @@ display_basic(void) } else { report_cap(" (home)", cursor_home); } +#ifdef user9 report_cap("ENQ (u9)", user9); +#endif +#ifdef user8 report_cap("ACK (u8)", user8); +#endif - sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %ld. Frame size: %d.%d", columns, lines, tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); + sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %u. Frame size: %d.%d", + columns, lines, + tty_baud_rate, + tty_frame_size >> 1, + (tty_frame_size & 1) * 5); putln(temp); } @@ -192,9 +200,17 @@ curses_setup( ncurses starts scanning the termcap file. **/ if ((status = _nc_read_entry(tty_basename, tty_filename, &term)) == 0) { - fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename); - show_usage(exec_name); - exit(1); + const TERMTYPE *fallback = _nc_fallback(tty_basename); + + if (fallback) { + term = *fallback; + sprintf(tty_filename, "(fallback)%s", tty_basename); + status = 1; + } else { + fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename); + show_usage(exec_name); + exit(1); + } } if (status == -1) { fprintf(stderr, "Terminfo database is inaccessible\n");