From: Thomas E. Dickey Date: Sun, 8 Oct 2017 00:48:04 +0000 (+0000) Subject: ncurses 6.0 - patch 20171007 X-Git-Tag: v6.1~16 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=cd142df6d9934f1bda19f5b968cc666291be5072 ncurses 6.0 - patch 20171007 + modify "-T" option of clear and tput to call use_tioctl() to obtain the operating system's notion of the screensize if possible. + review/repair some exit-codes for tput, making usage-message exit with 2 rather than 1, and a failure to open terminal 4+errno. + amend check in tput, tabs and clear to allow those to use the database-only features in cron if a -T option gives a suitable terminal name (report by Lauri Tirkkonen). + correct an ifdef in test/ncurses.c for systems with soft-keys but not slk_color(). + regenerate man-html documentation. --- diff --git a/NEWS b/NEWS index 0dd7fc94..9892f2e3 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2961 2017/09/30 23:18:33 tom Exp $ +-- $Id: NEWS,v 1.2966 2017/10/07 23:37:31 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,18 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20171007 + + modify "-T" option of clear and tput to call use_tioctl() to obtain + the operating system's notion of the screensize if possible. + + review/repair some exit-codes for tput, making usage-message exit + with 2 rather than 1, and a failure to open terminal 4+errno. + + amend check in tput, tabs and clear to allow those to use the + database-only features in cron if a -T option gives a suitable + terminal name (report by Lauri Tirkkonen). + + correct an ifdef in test/ncurses.c for systems with soft-keys but + not slk_color(). + + regenerate man-html documentation. + 20170930 + fix a symbol conflict that made ncurses.c C/c menu not work with Solaris xpg4 curses. diff --git a/VERSION b/VERSION index 83d476af..7264566f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20170930 +5:0:9 6.0 20171007 diff --git a/dist.mk b/dist.mk index edb5da81..83cbf583 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1185 2017/09/28 08:10:00 tom Exp $ +# $Id: dist.mk,v 1.1186 2017/10/02 01:01:40 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 0 -NCURSES_PATCH = 20170930 +NCURSES_PATCH = 20171007 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/doc/html/man/adacurses6-config.1.html b/doc/html/man/adacurses6-config.1.html index ab19d973..7468ce62 100644 --- a/doc/html/man/adacurses6-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -125,7 +125,7 @@

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 60aa2693..be498ab5 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -64,7 +64,7 @@
        the  filename  or entry.  If TERMCAP is a full pathname to a file, only
        the terminal whose name is specified in the environment  variable  TERM
        is  extracted  from  that file.  If the environment variable TERMCAP is
-       not set, then the file /usr/local/ncurses/lib/terminfo is read.
+       not set, then the file /usr/share/terminfo is read.
 
        -v   print out tracing information on standard  error  as  the  program
             runs.
@@ -80,8 +80,7 @@
 
 
 

FILES

-       /usr/local/ncurses/lib/terminfo
-                           Compiled terminal description database.
+       /usr/share/terminfo Compiled terminal description database.
 
 
 

TRANSLATIONS FROM NONSTANDARD CAPABILITIES

@@ -111,8 +110,8 @@
        PD       kN     XENIX   key_npage
        PN       po     XENIX   prtr_off
        PS       pf     XENIX   prtr_on
-
        PU       kP     XENIX   key_ppage
+
        RT       @8     XENIX   kent
        UP       ku     XENIX   kcuu1
        KA       k;     Tek     key_f10
@@ -191,7 +190,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index 2a21936a..85a83053 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: clear.1,v 1.17 2017/08/19 14:12:50 tom Exp @
+  * @Id: clear.1,v 1.18 2017/10/07 21:30:17 tom Exp @
   * these would be fallbacks for DS/DE,
   * but groff changed the meaning of the macros.
 -->
@@ -72,7 +72,8 @@
        -T type
             indicates the type of terminal.  Normally this option is  unneces-
             sary,  because  the default is taken from the environment variable
-            TERM.
+            TERM.  If -T is specified, then the shell variables LINES and COL-
+            UMNS will also be ignored.
 
        -V   reports the version of ncurses which was used in this program, and
             exits.  The options are as follows:
@@ -82,11 +83,11 @@
 
 
 

HISTORY

-       A clear command appeared in 2.79BSD dated  February  24,  1979.   Later
+       A  clear  command  appeared  in 2.79BSD dated February 24, 1979.  Later
        that was provided in Unix 8th edition (1985).
 
-       AT&T  adapted  a  different  BSD  program  (tset) to make a new command
-       (tput), and used this to replace the clear command with a shell  script
+       AT&T adapted a different BSD program  (tset)  to  make  a  new  command
+       (tput),  and used this to replace the clear command with a shell script
        which calls tput clear, e.g.,
 
          /usr/bin/tput ${1:+-T$1} clear 2> /dev/null
@@ -99,13 +100,13 @@
 
        The remainder of the script in each case is a copyright notice.
 
-       The ncurses clear command began in 1995 by adapting  the  original  BSD
+       The  ncurses  clear  command began in 1995 by adapting the original BSD
        clear command (with terminfo, of course).
 
        The E3 extension came later:
 
-       o   In  June  1999, xterm provided an extension to the standard control
-           sequence for clearing the screen.  Rather than  clearing  just  the
+       o   In June 1999, xterm provided an extension to the  standard  control
+           sequence  for  clearing  the screen.  Rather than clearing just the
            visible part of the screen using
 
              printf '\033[2J'
@@ -114,24 +115,24 @@
 
              printf '\033[3J'
 
-           This  is  documented in XTerm Control Sequences as a feature origi-
+           This is documented in XTerm Control Sequences as a  feature  origi-
            nating with xterm.
 
        o   A few other terminal developers adopted the feature, e.g., PuTTY in
            2006.
 
-       o   In  April  2011, a Red Hat developer submitted a patch to the Linux
-           kernel, modifying its console driver to do  the  same  thing.   The
-           Linux  change,  part  of  the  3.0  release, did not mention xterm,
+       o   In April 2011, a Red Hat developer submitted a patch to  the  Linux
+           kernel,  modifying  its  console  driver to do the same thing.  The
+           Linux change, part of the  3.0  release,  did  not  mention  xterm,
            although it was cited in the Red Hat bug report (#683733) which led
            to the change.
 
-       o   Again,  a  few  other terminal developers adopted the feature.  But
+       o   Again, a few other terminal developers adopted  the  feature.   But
            the next relevant step was a change to the clear program in 2013 to
            incorporate this extension.
 
-       o   In  2013,  the E3 extension was overlooked in tput with the "clear"
-           parameter.  That was addressed in  2016  by  reorganizing  tput  to
+       o   In 2013, the E3 extension was overlooked in tput with  the  "clear"
+           parameter.   That  was  addressed  in  2016 by reorganizing tput to
            share its logic with clear and tset.
 
 
@@ -139,15 +140,15 @@
        Neither IEEE Std 1003.1/The Open  Group  Base  Specifications  Issue  7
        (POSIX.1-2008) nor X/Open Curses Issue 7 documents tset or reset.
 
-       The latter documents tput, which could be used to replace this  utility
-       either  via  a shell script or by an alias (such as a symbolic link) to
+       The  latter documents tput, which could be used to replace this utility
+       either via a shell script or by an alias (such as a symbolic  link)  to
        run tput as clear.
 
 
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/curs_memleaks.3x.html b/doc/html/man/curs_memleaks.3x.html
index 1aecb888..20cc59d6 100644
--- a/doc/html/man/curs_memleaks.3x.html
+++ b/doc/html/man/curs_memleaks.3x.html
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_memleaks.3x,v 1.5 2017/07/28 00:04:34 tom Exp @
+  * @Id: curs_memleaks.3x,v 1.6 2017/08/22 08:35:37 Sven.Joachim Exp @
 -->
 
 
@@ -46,7 +46,7 @@
 
 
 

NAME

-       _nc_freeall _nc_free_and_exit _nc_free_tinfo - curses memory-leak
+       _nc_freeall, _nc_free_and_exit, _nc_free_tinfo - curses memory-leak
        checking
 
 
diff --git a/doc/html/man/curs_util.3x.html b/doc/html/man/curs_util.3x.html
index e4249aa8..f7ee7b39 100644
--- a/doc/html/man/curs_util.3x.html
+++ b/doc/html/man/curs_util.3x.html
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_util.3x,v 1.49 2017/05/30 21:09:21 tom Exp @
+  * @Id: curs_util.3x,v 1.51 2017/10/07 21:47:25 tom Exp @
 -->
 
 
@@ -110,112 +110,119 @@
 
 

filter/nofilter

        The filter routine, if used, must be called before initscr  or  newterm
-       are called.  The effect is that, during those calls, LINES is set to 1;
-       the capabilities clear, cup, cud, cud1, cuu1, cuu,  vpa  are  disabled;
-       and the home string is set to the value of cr.
+       are called.  Calling filter causes these changes in initialization:
 
-       The  nofilter  routine  cancels  the effect of a preceding filter call.
-       That allows the caller to initialize a screen on  a  different  device,
-       using  a  different  value of $TERM.  The limitation arises because the
+       o   LINES is set to 1;
+
+       o   the  capabilities  clear,  cud1,  cud, cup, cuu1, cuu, vpa are dis-
+           abled;
+
+       o   the capability ed is disabled if bce is set;
+
+       o   and the home string is set to the value of cr.
+
+       The nofilter routine cancels the effect of  a  preceding  filter  call.
+       That  allows  the  caller to initialize a screen on a different device,
+       using a different value of $TERM.  The limitation  arises  because  the
        filter routine modifies the in-memory copy of the terminal information.
 
 
 

use_env

-       The use_env routine, if  used,  should  be  called  before  initscr  or
-       newterm  are  called (because those compute the screen size).  It modi-
-       fies the way ncurses treats environment variables when determining  the
+       The  use_env  routine,  if  used,  should  be  called before initscr or
+       newterm are called (because those compute the screen size).   It  modi-
+       fies  the way ncurses treats environment variables when determining the
        screen size.
 
-       o   Normally  ncurses  looks  first  at  the  terminal database for the
+       o   Normally ncurses looks first  at  the  terminal  database  for  the
            screen size.
 
-           If use_env was called with FALSE for parameter, it stops  here  un-
-           less If use_tioctl was also called with TRUE for parameter.
+           If  use_env  was called with FALSE for parameter, it stops here un-
+           less use_tioctl was also called with TRUE for parameter.
 
-       o   Then  it  asks  for the screen size via operating system calls.  If
+       o   Then it asks for the screen size via operating  system  calls.   If
            successful, it overrides the values from the terminal database.
 
-       o   Finally (unless use_env was called with FALSE  parameter),  ncurses
-           examines  the LINES or COLUMNS environment variables, using a value
-           in those to override the results from the operating system or  ter-
+       o   Finally  (unless  use_env was called with FALSE parameter), ncurses
+           examines the LINES or COLUMNS environment variables, using a  value
+           in  those to override the results from the operating system or ter-
            minal database.
 
-           Ncurses  also  updates the screen size in response to SIGWINCH, un-
+           Ncurses also updates the screen size in response to  SIGWINCH,  un-
            less overridden by the LINES or COLUMNS environment variables,
 
 
 

use_tioctl

-       The use_tioctl routine, if used, should be  called  before  initscr  or
-       newterm  are  called  (because  those  compute the screen size).  After
-       use_tioctl is called with TRUE as an  argument,  ncurses  modifies  the
+       The  use_tioctl  routine,  if  used, should be called before initscr or
+       newterm are called (because those  compute  the  screen  size).   After
+       use_tioctl  is  called  with  TRUE as an argument, ncurses modifies the
        last step in its computation of screen size as follows:
 
-       o   checks  if the LINES and COLUMNS environment variables are set to a
+       o   checks if the LINES and COLUMNS environment variables are set to  a
            number greater than zero.
 
-       o   for each, ncurses updates the  corresponding  environment  variable
-           with  the  value  that it has obtained via operating system call or
+       o   for  each,  ncurses  updates the corresponding environment variable
+           with the value that it has obtained via operating  system  call  or
            from the terminal database.
 
-       o   ncurses re-fetches the value of the environment variables  so  that
+       o   ncurses  re-fetches  the value of the environment variables so that
            it is still the environment variables which set the screen size.
 
        The use_env and use_tioctl routines combine as summarized here:
 
            use_env   use_tioctl   Summary
            ----------------------------------------------------------------
-           TRUE      FALSE        This  is  the default behavior.  ncurses
+           TRUE      FALSE        This is the default  behavior.   ncurses
                                   uses operating system calls unless over-
                                   ridden by $LINES or $COLUMNS environment
                                   variables.
-           TRUE      TRUE         ncurses  updates  $LINES  and   $COLUMNS
+           TRUE      TRUE         ncurses   updates  $LINES  and  $COLUMNS
                                   based on operating system calls.
            FALSE     TRUE         ncurses ignores $LINES and $COLUMNS, us-
                                   es  operating  system  calls  to  obtain
                                   size.
-           FALSE     FALSE        ncurses  relies on the terminal database
+           FALSE     FALSE        ncurses relies on the terminal  database
                                   to determine size.
 
 
 

putwin/getwin

-       The putwin routine writes all data associated with window (or pad)  win
+       The  putwin routine writes all data associated with window (or pad) win
        into the file to which filep points.  This information can be later re-
        trieved using the getwin function.
 
-       The getwin routine reads window related data  stored  in  the  file  by
-       putwin.   The  routine  then creates and initializes a new window using
-       that data.  It returns a pointer to the new window.  There  are  a  few
+       The  getwin  routine  reads  window  related data stored in the file by
+       putwin.  The routine then creates and initializes a  new  window  using
+       that  data.   It  returns a pointer to the new window.  There are a few
        caveats:
 
        o   the data written is a copy of the WINDOW structure, and its associ-
-           ated character cells.  The format differs between the  wide-charac-
-           ter  (ncursesw) and non-wide (ncurses) libraries.  You can transfer
+           ated  character cells.  The format differs between the wide-charac-
+           ter (ncursesw) and non-wide (ncurses) libraries.  You can  transfer
            data between the two, however.
 
-       o   the retrieved window is always created as a  top-level  window  (or
+       o   the  retrieved  window  is always created as a top-level window (or
            pad), rather than a subwindow.
 
-       o   the  window's character cells contain the color pair value, but not
-           the actual color numbers.  If cells in  the  retrieved  window  use
-           color  pairs  which  have not been created in the application using
+       o   the window's character cells contain the color pair value, but  not
+           the  actual  color  numbers.   If cells in the retrieved window use
+           color pairs which have not been created in  the  application  using
            init_pair, they will not be colored when the window is refreshed.
 
 
 

delay_output

-       The delay_output routine inserts an ms  millisecond  pause  in  output.
-       This  routine should not be used extensively because padding characters
-       are used rather than a CPU pause.  If no padding  character  is  speci-
+       The  delay_output  routine  inserts  an ms millisecond pause in output.
+       This routine should not be used extensively because padding  characters
+       are  used  rather  than a CPU pause.  If no padding character is speci-
        fied, this uses napms to perform the delay.
 
 
 

flushinp

-       The  flushinp  routine throws away any typeahead that has been typed by
+       The flushinp routine throws away any typeahead that has been  typed  by
        the user and has not yet been read by the program.
 
 
 

RETURN VALUE

-       Except for flushinp, routines that return an integer  return  ERR  upon
-       failure  and OK (SVr4 specifies only "an integer value other than ERR")
+       Except  for  flushinp,  routines that return an integer return ERR upon
+       failure and OK (SVr4 specifies only "an integer value other than  ERR")
        upon successful completion.
 
        Routines that return pointers return NULL on error.
@@ -226,77 +233,77 @@
                returns an error if the terminal was not initialized.
 
           putwin
-               returns an error if the associated fwrite calls return  an  er-
+               returns  an  error if the associated fwrite calls return an er-
                ror.
 
 
 

PORTABILITY

 
 

filter

-       The  SVr4  documentation  describes  the  action  of filter only in the
-       vaguest terms.  The description here is adapted  from  the  XSI  Curses
+       The SVr4 documentation describes the  action  of  filter  only  in  the
+       vaguest  terms.   The  description  here is adapted from the XSI Curses
        standard (which erroneously fails to describe the disabling of cuu).
 
 
 

keyname

-       The  keyname function may return the names of user-defined string capa-
-       bilities which are defined in the terminfo entry via the -x  option  of
+       The keyname function may return the names of user-defined string  capa-
+       bilities  which  are defined in the terminfo entry via the -x option of
        tic.  This implementation automatically assigns at run-time keycodes to
-       user-defined strings which begin  with  "k".   The  keycodes  start  at
+       user-defined  strings  which  begin  with  "k".   The keycodes start at
        KEY_MAX, but are not guaranteed to be the same value for different runs
-       because user-defined codes are merged from  all  terminal  descriptions
-       which  have  been loaded.  The use_extended_names(3x) function controls
-       whether this data is loaded when the terminal description  is  read  by
+       because  user-defined  codes  are merged from all terminal descriptions
+       which have been loaded.  The use_extended_names(3x)  function  controls
+       whether  this  data  is loaded when the terminal description is read by
        the library.
 
 
 

nofilter/use_tioctl

-       The  nofilter  and  use_tioctl  routines are specific to ncurses.  They
-       were not supported on Version 7, BSD or System V  implementations.   It
-       is  recommended that any code depending on ncurses extensions be condi-
+       The nofilter and use_tioctl routines are  specific  to  ncurses.   They
+       were  not  supported on Version 7, BSD or System V implementations.  It
+       is recommended that any code depending on ncurses extensions be  condi-
        tioned using NCURSES_VERSION.
 
 
 

putwin/getwin

        The putwin and getwin functions have several issues with portability:
 
-       o   The files written and read by these functions  use  an  implementa-
+       o   The  files  written  and read by these functions use an implementa-
            tion-specific format.  Although the format is an obvious target for
            standardization, it has been overlooked.
 
-           Interestingly enough, according to the copyright dates  in  Solaris
-           source,  the  functions (along with scr_init, etc.) originated with
+           Interestingly  enough,  according to the copyright dates in Solaris
+           source, the functions (along with scr_init, etc.)  originated  with
            the University of California, Berkeley (in 1982) and were later (in
-           1988)  incorporated  into SVr4.  Oddly, there are no such functions
+           1988) incorporated into SVr4.  Oddly, there are no  such  functions
            in the 4.3BSD curses sources.
 
        o   Most implementations simply dump the binary WINDOW structure to the
-           file.   These  include SVr4 curses, NetBSD and PDCurses, as well as
+           file.  These include SVr4 curses, NetBSD and PDCurses, as  well  as
            older ncurses versions.  This implementation (as well as the X/Open
            variant of Solaris curses, dated 1995) uses textual dumps.
 
-           The  implementations  which  use  binary  dumps  use block-I/O (the
-           fwrite and fread functions).  Those  that  use  textual  dumps  use
+           The implementations which  use  binary  dumps  use  block-I/O  (the
+           fwrite  and  fread  functions).   Those  that use textual dumps use
            buffered-I/O.  A few applications may happen to write extra data in
-           the file using these functions.  Doing that can run  into  problems
-           mixing  block-  and  buffered-I/O.  This implementation reduces the
-           problem on writes by flushing the output.  However, reading from  a
+           the  file  using these functions.  Doing that can run into problems
+           mixing block- and buffered-I/O.  This  implementation  reduces  the
+           problem  on writes by flushing the output.  However, reading from a
            file written using mixed schemes may not be successful.
 
 
 

unctrl/wunctrl

-       The  XSI Curses standard, Issue 4 describes these functions.  It states
+       The XSI Curses standard, Issue 4 describes these functions.  It  states
        that unctrl and wunctrl will return a null pointer if unsuccessful, but
-       does  not  define any error conditions.  This implementation checks for
+       does not define any error conditions.  This implementation  checks  for
        three cases:
 
-       o   the parameter is a 7-bit US-ASCII code.   This  is  the  case  that
+       o   the  parameter  is  a  7-bit  US-ASCII code.  This is the case that
            X/Open Curses documented.
 
        o   the parameter is in the range 128-159, i.e., a C1 control code.  If
-           use_legacy_coding has been called with a 2  parameter,  unctrl  re-
-           turns  the parameter, i.e., a one-character string with the parame-
-           ter as the first character.   Otherwise,  it  returns  "~@",  "~A",
+           use_legacy_coding  has  been  called with a 2 parameter, unctrl re-
+           turns the parameter, i.e., a one-character string with the  parame-
+           ter  as  the  first  character.   Otherwise, it returns "~@", "~A",
            etc., analogous to "^@", "^A", C0 controls.
 
            X/Open Curses does not document whether unctrl can be called before
@@ -307,28 +314,28 @@
            pointer.
 
        The strings returned by unctrl in this implementation are determined at
-       compile  time,  showing C1 controls from the upper-128 codes with a "~"
-       prefix rather than "^".  Other implementations have  different  conven-
+       compile time, showing C1 controls from the upper-128 codes with  a  "~"
+       prefix  rather  than "^".  Other implementations have different conven-
        tions.  For example, they may show both sets of control characters with
        "^", and strip the parameter to 7 bits.  Or they may ignore C1 controls
        and treat all of the upper-128 codes as printable.  This implementation
-       uses 8 bits but does not modify the  string  to  reflect  locale.   The
-       use_legacy_coding  function  allows  the caller to change the output of
+       uses  8  bits  but  does  not modify the string to reflect locale.  The
+       use_legacy_coding function allows the caller to change  the  output  of
        unctrl.
 
-       Likewise, the meta(3x) function allows the caller to change the  output
-       of  keyname,  i.e.,  it  determines  whether to use the "M-" prefix for
-       "meta" keys (codes in the range 128 to  255).   Both  use_legacy_coding
-       and  meta succeed only after curses is initialized.  X/Open Curses does
-       not document the treatment of codes 128 to 159.  When treating them  as
-       "meta"  keys (or if keyname is called before initializing curses), this
+       Likewise,  the meta(3x) function allows the caller to change the output
+       of keyname, i.e., it determines whether to  use  the  "M-"  prefix  for
+       "meta"  keys  (codes  in the range 128 to 255).  Both use_legacy_coding
+       and meta succeed only after curses is initialized.  X/Open Curses  does
+       not  document the treatment of codes 128 to 159.  When treating them as
+       "meta" keys (or if keyname is called before initializing curses),  this
        implementation returns strings "M-^@", "M-^A", etc.
 
 
 

use_env/use_tioctl

-       If ncurses is configured to provide  the  sp-functions  extension,  the
-       state  of  use_env  and  use_tioctl may be updated before creating each
-       screen rather than once  only  (curs_sp_funcs(3x)).   This  feature  of
+       If  ncurses  is  configured  to provide the sp-functions extension, the
+       state of use_env and use_tioctl may be  updated  before  creating  each
+       screen  rather  than  once  only  (curs_sp_funcs(3x)).  This feature of
        use_env is not provided by other implementation of curses.
 
 
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index 76f3376a..da0733f8 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -234,7 +234,7 @@
        curses(3x)  and  related  pages  whose names begin "form_" for detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index ff6ea36a..210097bd 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -449,8 +449,7 @@
 
 
 

FILES

-       /usr/local/ncurses/lib/terminfo
-                           Compiled terminal description database.
+       /usr/share/terminfo Compiled terminal description database.
 
 
 

EXTENSIONS

@@ -477,7 +476,7 @@
 
        http://invisible-island.net/ncurses/tctest.html
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 

AUTHOR

diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index acd41ad6..f3c7db53 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -74,8 +74,7 @@
 
 
 

FILES

-       /usr/local/ncurses/lib/terminfo
-                           Compiled terminal description database.
+       /usr/share/terminfo Compiled terminal description database.
 
 
 

NOTES

@@ -86,7 +85,7 @@
 

SEE ALSO

        curses(3x), tic(1m), infocmp(1m), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 

AUTHOR

diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index d744b115..7843459d 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -210,7 +210,7 @@
        curses(3x) and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index d92016ce..69069d51 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -59,7 +59,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
        The  ncurses  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
@@ -176,7 +176,7 @@
        standard  place.  For example, if TERM is set to att4424, then the com-
        piled terminal definition is found in
 
-         /usr/local/ncurses/lib/terminfo/a/att4424.
+         /usr/share/terminfo/a/att4424.
 
        (The a is copied from the first letter of att4424 to avoid creation  of
        huge  directories.)   However,  if  TERMINFO  is  set to $HOME/myterms,
@@ -186,10 +186,10 @@
 
        and if that fails, it then checks
 
-         /usr/local/ncurses/lib/terminfo/a/att4424.
+         /usr/share/terminfo/a/att4424.
 
        This is useful for developing experimental definitions  or  when  write
-       permission in /usr/local/ncurses/lib/terminfo is not available.
+       permission in /usr/share/terminfo is not available.
 
        The integer variables LINES and COLS are defined in <curses.h> and will
        be filled in by initscr with the size of  the  screen.   The  constants
@@ -1091,14 +1091,13 @@
              o   /usr/local/ncurses/share/terminfo:/usr/share/terminfo (corre-
                  sponding to the TERMINFO_DIRS variable)
 
-             o   /usr/local/ncurses/lib/terminfo  (corresponding  to  the TER-
-                 MINFO variable)
+             o   /usr/share/terminfo (corresponding to the TERMINFO variable)
 
 
 

TERMINFO_DIRS

-       Specifies a list of locations  to  search  for  terminal  descriptions.
-       Each  location  in  the list is a terminal database as described in the
-       section on the TERMINFO variable.  The  list  is  separated  by  colons
+       Specifies  a  list  of  locations  to search for terminal descriptions.
+       Each location in the list is a terminal database as  described  in  the
+       section  on  the  TERMINFO  variable.   The list is separated by colons
        (i.e., ":") on Unix, semicolons on OS/2 EMX.
 
        There is no corresponding feature in System V terminfo; it is an exten-
@@ -1106,11 +1105,11 @@
 
 
 

TERMPATH

-       If TERMCAP does not hold a file name then ncurses checks  the  TERMPATH
-       environment  variable.  This is a list of filenames separated by spaces
+       If  TERMCAP  does not hold a file name then ncurses checks the TERMPATH
+       environment variable.  This is a list of filenames separated by  spaces
        or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
 
-       If the TERMPATH environment variable is not set, ncurses looks  in  the
+       If  the  TERMPATH environment variable is not set, ncurses looks in the
        files
 
          /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap,
@@ -1118,7 +1117,7 @@
        in that order.
 
        The library may be configured to disregard the following variables when
-       the current user is the superuser (root), or if  the  application  uses
+       the  current  user  is the superuser (root), or if the application uses
        setuid or setgid permissions:
 
          $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
@@ -1126,8 +1125,8 @@
 
 

ALTERNATE CONFIGURATIONS

        Several different configurations are possible, depending on the config-
-       ure script options used when building ncurses.  There are  a  few  main
-       options  whose  effects are visible to the applications developer using
+       ure  script  options  used when building ncurses.  There are a few main
+       options whose effects are visible to the applications  developer  using
        ncurses:
 
        --disable-overwrite
@@ -1135,19 +1134,19 @@
 
               #include <curses.h>
 
-            This option is used to avoid filename conflicts  when  ncurses  is
+            This  option  is  used to avoid filename conflicts when ncurses is
             not the main implementation of curses of the computer.  If ncurses
-            is installed disabling overwrite, it puts its headers in a  subdi-
+            is  installed disabling overwrite, it puts its headers in a subdi-
             rectory, e.g.,
 
               #include <ncurses/curses.h>
 
-            It  also  omits  a  symbolic  link  which  would  allow you to use
+            It also omits a  symbolic  link  which  would  allow  you  to  use
             -lcurses to build executables.
 
        --enable-widec
-            The configure script  renames  the  library  and  (if  the  --dis-
-            able-overwrite  option is used) puts the header files in a differ-
+            The  configure  script  renames  the  library  and  (if the --dis-
+            able-overwrite option is used) puts the header files in a  differ-
             ent subdirectory.  All of the library names have a "w" appended to
             them, i.e., instead of
 
@@ -1158,23 +1157,23 @@
               -lncursesw
 
             You must also define _XOPEN_SOURCE_EXTENDED when compiling for the
-            wide-character library to use the extended (wide-character)  func-
-            tions.   The curses.h file which is installed for the wide-charac-
+            wide-character  library to use the extended (wide-character) func-
+            tions.  The curses.h file which is installed for the  wide-charac-
             ter library is designed to be compatible with the normal library's
-            header.   Only  the size of the WINDOW structure differs, and very
-            few applications require more than a pointer to WINDOWs.   If  the
+            header.  Only the size of the WINDOW structure differs,  and  very
+            few  applications  require more than a pointer to WINDOWs.  If the
             headers  are  installed  allowing  overwrite,  the  wide-character
-            library's headers should be installed last, to allow  applications
+            library's  headers should be installed last, to allow applications
             to be built using either library from the same set of headers.
 
        --with-pthread
-            The  configure  script  renames  the  library.  All of the library
-            names have a "t"  appended  to  them  (before  any  "w"  added  by
+            The configure script renames the  library.   All  of  the  library
+            names  have  a  "t"  appended  to  them  (before  any "w" added by
             --enable-widec).
 
             The global variables such as LINES are replaced by macros to allow
             read-only access.  At the same time, setter-functions are provided
-            to  set  these  values.   Some applications (very few) may require
+            to set these values.  Some applications  (very  few)  may  require
             changes to work with this convention.
 
        --with-shared
@@ -1184,23 +1183,22 @@
        --with-debug
 
        --with-profile
-            The shared and normal (static) library names differ by their  suf-
-            fixes,  e.g.,  libncurses.so and libncurses.a.  The debug and pro-
-            filing libraries add a "_g" and a "_p" to the root  names  respec-
+            The  shared and normal (static) library names differ by their suf-
+            fixes, e.g., libncurses.so and libncurses.a.  The debug  and  pro-
+            filing  libraries  add a "_g" and a "_p" to the root names respec-
             tively, e.g., libncurses_g.a and libncurses_p.a.
 
        --with-trace
-            The  trace  function normally resides in the debug library, but it
+            The trace function normally resides in the debug library,  but  it
             is sometimes useful to configure this in the shared library.  Con-
-            figure  scripts  should  check for the function's existence rather
+            figure scripts should check for the  function's  existence  rather
             than assuming it is always in the debug library.
 
 
 

FILES

        /usr/share/tabset
-            directory containing initialization files for the  terminal  capa-
-            bility  database /usr/local/ncurses/lib/terminfo terminal capabil-
-            ity database
+            directory  containing  initialization files for the terminal capa-
+            bility database /usr/share/terminfo terminal capability database
 
 
 

SEE ALSO

diff --git a/doc/html/man/ncurses6-config.1.html b/doc/html/man/ncurses6-config.1.html
index 0716fb07..fc93f936 100644
--- a/doc/html/man/ncurses6-config.1.html
+++ b/doc/html/man/ncurses6-config.1.html
@@ -96,7 +96,7 @@
 
        --terminfo
               echos the $TERMINFO terminfo database path, e.g.,
-              /usr/local/ncurses/lib/terminfo
+              /usr/share/terminfo
 
        --terminfo-dirs
               echos the $TERMINFO_DIRS directory list, e.g.,
@@ -112,7 +112,7 @@
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html
index aceb1b5f..216698b6 100644
--- a/doc/html/man/panel.3x.html
+++ b/doc/html/man/panel.3x.html
@@ -194,7 +194,7 @@
 

SEE ALSO

        curses(3x), curs_variables(3x),
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 

AUTHOR

diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html
index b5bc3ac0..073235ed 100644
--- a/doc/html/man/tabs.1.html
+++ b/doc/html/man/tabs.1.html
@@ -164,7 +164,7 @@
 

SEE ALSO

        tset(1), infocmp(1m), curses(3x), terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20170819).
+       This describes ncurses version 6.0 (patch 20171007).
 
 
 
diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html
index 6dacae61..4d398c3f 100644
--- a/doc/html/man/term.5.html
+++ b/doc/html/man/term.5.html
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: term.5,v 1.26.1.3 2017/05/27 23:28:31 tom Exp @
+  * @Id: term.5,v 1.26 2017/02/18 16:58:21 tom Exp @
 -->
 
 
@@ -57,45 +57,44 @@
 
 

STORAGE LOCATION

        Compiled   terminfo   descriptions   are  placed  under  the  directory
-       /usr/local/ncurses/lib/terminfo.   Two  configurations  are   supported
-       (when building the ncurses libraries):
+       /usr/share/terminfo.  Two configurations are supported  (when  building
+       the ncurses libraries):
 
        directory tree
             A two-level scheme is used to avoid a linear search of a huge UNIX
-            system  directory:  /usr/local/ncurses/lib/terminfo/c/name   where
-            name  is the name of the terminal, and c is the first character of
-            name.     Thus,    act4    can    be    found    in    the    file
-            /usr/local/ncurses/lib/terminfo/a/act4.   Synonyms  for  the  same
-            terminal are implemented by multiple links to  the  same  compiled
-            file.
+            system directory: /usr/share/terminfo/c/name  where  name  is  the
+            name of the terminal, and c is the first character of name.  Thus,
+            act4 can be found in the  file  /usr/share/terminfo/a/act4.   Syn-
+            onyms  for  the same terminal are implemented by multiple links to
+            the same compiled file.
 
        hashed database
             Using Berkeley database, two types of records are stored: the ter-
-            minfo data in the same format as stored in a directory  tree  with
-            the  terminfo's primary name as a key, and records containing only
+            minfo  data  in the same format as stored in a directory tree with
+            the terminfo's primary name as a key, and records containing  only
             aliases pointing to the primary name.
 
-            If built to write hashed databases, ncurses can  still  read  ter-
-            minfo  databases  organized  as a directory tree, but cannot write
-            entries into the  directory  tree.   It  can  write  (or  rewrite)
+            If  built  to  write hashed databases, ncurses can still read ter-
+            minfo databases organized as a directory tree,  but  cannot  write
+            entries  into  the  directory  tree.   It  can  write (or rewrite)
             entries in the hashed database.
 
-            ncurses  distinguishes  the  two  cases  in  the TERMINFO and TER-
-            MINFO_DIRS environment variable by assuming a directory  tree  for
+            ncurses distinguishes the two  cases  in  the  TERMINFO  and  TER-
+            MINFO_DIRS  environment  variable by assuming a directory tree for
             entries that correspond to an existing directory, and hashed data-
             base otherwise.
 
 
-

LEGACY STORAGE FORMAT

+

STORAGE FORMAT

        The format has been chosen so that it will be the same on all hardware.
-       An  8 or more bit byte is assumed, but no assumptions about byte order-
+       An 8 or more bit byte is assumed, but no assumptions about byte  order-
        ing or sign extension are made.
 
        The compiled file is created with the tic program, and read by the rou-
-       tine  setupterm(3x).   The  file is divided into six parts: the header,
+       tine setupterm(3x).  The file is divided into six  parts:  the  header,
        terminal names, boolean flags, numbers, strings, and string table.
 
-       The header section begins the file.  This section  contains  six  short
+       The  header  section  begins the file.  This section contains six short
        integers in the format described below.  These integers are
 
             (1) the magic number (octal 0432);
@@ -110,62 +109,62 @@
 
             (6) the size, in bytes, of the string table.
 
-       Short  integers are stored in two 8-bit bytes.  The first byte contains
+       Short integers are stored in two 8-bit bytes.  The first byte  contains
        the least significant 8 bits of the value, and the second byte contains
-       the  most significant 8 bits.  (Thus, the value represented is 256*sec-
-       ond+first.)  The value -1 is represented by the two bytes  0377,  0377;
-       other  negative values are illegal. This value generally means that the
+       the most significant 8 bits.  (Thus, the value represented is  256*sec-
+       ond+first.)   The  value -1 is represented by the two bytes 0377, 0377;
+       other negative values are illegal. This value generally means that  the
        corresponding capability is missing from this terminal.  Note that this
        format corresponds to the hardware of the VAX and PDP-11 (that is, lit-
-       tle-endian machines).  Machines where this does not correspond  to  the
-       hardware  must  read  the integers as two bytes and compute the little-
+       tle-endian  machines).   Machines where this does not correspond to the
+       hardware must read the integers as two bytes and  compute  the  little-
        endian value.
 
-       The terminal names section comes next.  It contains the first  line  of
-       the  terminfo  description, listing the various names for the terminal,
-       separated by the "|" character.  The  section  is  terminated  with  an
+       The  terminal  names section comes next.  It contains the first line of
+       the terminfo description, listing the various names for  the  terminal,
+       separated  by  the  "|"  character.   The section is terminated with an
        ASCII NUL character.
 
-       The  boolean  flags have one byte for each flag.  This byte is either 0
-       or 1 as the flag is present or absent.  The  capabilities  are  in  the
+       The boolean flags have one byte for each flag.  This byte is  either  0
+       or  1  as  the  flag is present or absent.  The capabilities are in the
        same order as the file <term.h>.
 
        Between the boolean section and the number section, a null byte will be
-       inserted, if necessary, to ensure that the number section begins on  an
+       inserted,  if necessary, to ensure that the number section begins on an
        even byte (this is a relic of the PDP-11's word-addressed architecture,
-       originally designed in to avoid IOT traps induced by addressing a  word
-       on  an  odd  byte boundary).  All short integers are aligned on a short
+       originally  designed in to avoid IOT traps induced by addressing a word
+       on an odd byte boundary).  All short integers are aligned  on  a  short
        word boundary.
 
-       The numbers section is similar to the flags section.   Each  capability
+       The  numbers  section is similar to the flags section.  Each capability
        takes up two bytes, and is stored as a little-endian short integer.  If
        the value represented is -1, the capability is taken to be missing.
 
-       The strings section is also similar.  Each capability is  stored  as  a
+       The  strings  section  is also similar.  Each capability is stored as a
        short integer, in the format above.  A value of -1 means the capability
        is missing.  Otherwise, the value is taken as an offset from the begin-
-       ning  of the string table.  Special characters in ^X or \c notation are
-       stored in their interpreted  form,  not  the  printing  representation.
-       Padding  information  $<nn>  and  parameter  information  %x are stored
+       ning of the string table.  Special characters in ^X or \c notation  are
+       stored  in  their  interpreted  form,  not the printing representation.
+       Padding information $<nn>  and  parameter  information  %x  are  stored
        intact in uninterpreted form.
 
-       The final section is the string table.  It contains all the  values  of
-       string  capabilities  referenced in the string section.  Each string is
+       The  final  section is the string table.  It contains all the values of
+       string capabilities referenced in the string section.  Each  string  is
        null terminated.
 
 
 

EXTENDED STORAGE FORMAT

        The previous section describes the conventional terminfo binary format.
-       With  some  minor variations of the offsets (see PORTABILITY), the same
-       binary format is used in all modern UNIX systems.  Each system  uses  a
+       With some minor variations of the offsets (see PORTABILITY),  the  same
+       binary  format  is used in all modern UNIX systems.  Each system uses a
        predefined set of boolean, number or string capabilities.
 
        The ncurses libraries and applications support extended terminfo binary
-       format, allowing users to define capabilities which are loaded at  run-
+       format,  allowing users to define capabilities which are loaded at run-
        time.  This extension is made possible by using the fact that the other
-       implementations stop reading the terminfo data when they  have  reached
-       the  end of the size given in the header.  ncurses checks the size, and
-       if it exceeds that due to  the  predefined  data,  continues  to  parse
+       implementations  stop  reading the terminfo data when they have reached
+       the end of the size given in the header.  ncurses checks the size,  and
+       if  it  exceeds  that  due  to  the predefined data, continues to parse
        according to its own scheme.
 
        First, it reads the extended header (5 short integers):
@@ -183,32 +182,11 @@
        Using the counts and sizes, ncurses allocates arrays and reads data for
        the extended capabilities in the same order as the header information.
 
-       The extended string table  contains  values  for  string  capabilities.
-       After  the  end  of these values, it contains the names for each of the
-       extended capabilities  in  order,  e.g.,  booleans,  then  numbers  and
+       The  extended  string  table  contains  values for string capabilities.
+       After the end of these values, it contains the names for  each  of  the
+       extended  capabilities  in  order,  e.g.,  booleans,  then  numbers and
        finally strings.
 
-       Applications  which  manipulate  terminal  data can use the definitions
-       described in term_variables(3x) which  associate  the  long  capability
-       names with members of a TERMTYPE structure.
-
-
-

EXTENDED NUMBER FORMAT

-       On occasion, 16-bit signed integers are not large enough.  With ncurses
-       6.1, a new format is introduced by making a few changes to  the  legacy
-       format:
-
-       o   a different magic number (0542)
-
-       o   changing  the type for the number array from signed 16-bit integers
-           to signed 32-bit integers.
-
-       To maintain compatibility, the library presents the  same  data  struc-
-       tures to direct users of the TERMTYPE structure as in previous formats.
-       However, that cannot provide callers with the  extended  numbers.   The
-       library  uses  a similar but hidden data structure TERMTYPE2 to provide
-       data for the terminfo functions.
-
 
 

PORTABILITY

        Note that it is possible for setupterm to expect  a  different  set  of
@@ -231,66 +209,50 @@
        terminfo(5)  for  detailed  discussion of terminfo source compatibility
        issues.
 
-       Direct access to the TERMTYPE structure is provided for legacy applica-
-       tions.   Portable  applications  should  use  the tigetflag and related
-       functions described in curs_terminfo(3x) for reading terminal capabili-
-       ties.
-
 
 

EXAMPLE

-       As an example, here is a description for the Lear-Siegler ADM-3, a pop-
-       ular though rather stupid early terminal:
-
-         adm3a|lsi adm3a,
-                 am,
-                 cols#80, lines#24,
-                 bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
-                 cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
-                 home=^^, ind=^J,
-
-
-       and a hexadecimal dump of the compiled terminal description:
-
-         0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
-         0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
-         0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
-         0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
-         0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
-         0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-         0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$<1
-         0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  >..=%p1% {32}%+%c
-         0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
-         0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
+       As an example, here is a hex dump of  the  description  for  the  Lear-
+       Siegler ADM-3, a popular though rather stupid early terminal:
+
+       adm3a|lsi adm3a,
+               am,
+               cols#80, lines#24,
+               bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
+               cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
+               home=^^, ind=^J,
+
+       0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
+       0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
+       0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
+       0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
+       0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
+       0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$<1
+       0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  >..=%p1% {32}%+%c
+       0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
+       0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
 
 
 
 

LIMITS

-       Some limitations:
-
-       o   total compiled entries cannot exceed 4096 bytes in the legacy  for-
-           mat.
-
-       o   total  compiled  entries  cannot exceed 32768 bytes in the extended
-           format.
-
-       o   the name field cannot exceed 128 bytes.
+       Some limitations: total compiled entries cannot exceed 4096 bytes.  The
+       name field cannot exceed 128 bytes.
 
 
 

FILES

-       /usr/local/ncurses/lib/terminfo/*/*     compiled  terminal   capability
-       data base
+       /usr/share/terminfo/*/*  compiled terminal capability data base
 
 
 

SEE ALSO

@@ -301,10 +263,8 @@
        Thomas E. Dickey
        extended terminfo format for ncurses 5.0
        hashed database support for ncurses 5.6
-       extended number support for ncurses 6.1
 
        Eric S. Raymond
-       documented legacy terminfo format, e.g., from pdcurses.
 
 
 
@@ -317,9 +277,8 @@
 
  • DESCRIPTION
  • PORTABILITY
  • diff --git a/doc/html/man/term.7.html b/doc/html/man/term.7.html index 334d625b..0d4ac03e 100644 --- a/doc/html/man/term.7.html +++ b/doc/html/man/term.7.html @@ -84,8 +84,8 @@ line. Terminal type descriptions are stored as files of capability data - underneath /usr/local/ncurses/lib/terminfo. To browse a list of all - terminal names recognized by the system, do + underneath /usr/share/terminfo. To browse a list of all terminal names + recognized by the system, do toe | more @@ -97,62 +97,61 @@ infocmp entry_name where entry_name is the name of the type you wish to examine (and the - name of its capability file the subdirectory of - /usr/local/ncurses/lib/terminfo named for its first letter). This com- - mand dumps a capability file in the text format described by ter- - minfo(5). + name of its capability file the subdirectory of /usr/share/terminfo + named for its first letter). This command dumps a capability file in + the text format described by terminfo(5). - The first line of a terminfo(5) description gives the names by which - terminfo knows a terminal, separated by "|" (pipe-bar) characters with + The first line of a terminfo(5) description gives the names by which + terminfo knows a terminal, separated by "|" (pipe-bar) characters with the last name field terminated by a comma. The first name field is the type's primary name, and is the one to use when setting TERM. The last - name field (if distinct from the first) is actually a description of - the terminal type (it may contain blanks; the others must be single - words). Name fields between the first and last (if present) are + name field (if distinct from the first) is actually a description of + the terminal type (it may contain blanks; the others must be single + words). Name fields between the first and last (if present) are aliases for the terminal, usually historical names retained for compat- ibility. - There are some conventions for how to choose terminal primary names - that help keep them informative and unique. Here is a step-by-step + There are some conventions for how to choose terminal primary names + that help keep them informative and unique. Here is a step-by-step guide to naming terminals that also explains how to parse them: - First, choose a root name. The root will consist of a lower-case let- - ter followed by up to seven lower-case letters or digits. You need to + First, choose a root name. The root will consist of a lower-case let- + ter followed by up to seven lower-case letters or digits. You need to avoid using punctuation characters in root names, because they are used - and interpreted as filenames and shell meta-characters (such as !, $, + and interpreted as filenames and shell meta-characters (such as !, $, *, ?, etc.) embedded in them may cause odd and unhelpful behavior. The - slash (/), or any other character that may be interpreted by anyone's - file system (\, $, [, ]), is especially dangerous (terminfo is plat- - form-independent, and choosing names with special characters could - someday make life difficult for users of a future port). The dot (.) - character is relatively safe as long as there is at most one per root + slash (/), or any other character that may be interpreted by anyone's + file system (\, $, [, ]), is especially dangerous (terminfo is plat- + form-independent, and choosing names with special characters could + someday make life difficult for users of a future port). The dot (.) + character is relatively safe as long as there is at most one per root name; some historical terminfo names use it. - The root name for a terminal or workstation console type should almost - always begin with a vendor prefix (such as hp for Hewlett-Packard, wy - for Wyse, or att for AT&T terminals), or a common name of the terminal - line (vt for the VT series of terminals from DEC, or sun for Sun - Microsystems workstation consoles, or regent for the ADDS Regent - series. You can list the terminfo tree to see what prefixes are - already in common use. The root name prefix should be followed when + The root name for a terminal or workstation console type should almost + always begin with a vendor prefix (such as hp for Hewlett-Packard, wy + for Wyse, or att for AT&T terminals), or a common name of the terminal + line (vt for the VT series of terminals from DEC, or sun for Sun + Microsystems workstation consoles, or regent for the ADDS Regent + series. You can list the terminfo tree to see what prefixes are + already in common use. The root name prefix should be followed when appropriate by a model number; thus vt100, hp2621, wy50. - The root name for a PC-Unix console type should be the OS name, i.e., - linux, bsdos, freebsd, netbsd. It should not be console or any other + The root name for a PC-Unix console type should be the OS name, i.e., + linux, bsdos, freebsd, netbsd. It should not be console or any other generic that might cause confusion in a multi-platform environment! If - a model number follows, it should indicate either the OS release level + a model number follows, it should indicate either the OS release level or the console driver release level. - The root name for a terminal emulator (assuming it does not fit one of + The root name for a terminal emulator (assuming it does not fit one of the standard ANSI or vt100 types) should be the program name or a read- ily recognizable abbreviation of it (i.e., versaterm, ctrm). - Following the root name, you may add any reasonable number of hyphen- + Following the root name, you may add any reasonable number of hyphen- separated feature suffixes. 2p Has two pages of memory. Likewise 4p, 8p, etc. - mc Magic-cookie. Some terminals (notably older Wyses) can only sup- + mc Magic-cookie. Some terminals (notably older Wyses) can only sup- port one attribute without magic-cookie lossage. Their base entry is usually paired with another that has this suffix and uses magic cookies to support multiple attributes. @@ -161,7 +160,7 @@ -m Mono mode - suppress color support. - -na No arrow keys - termcap ignores arrow keys which are actually + -na No arrow keys - termcap ignores arrow keys which are actually there on the terminal, so the user can use the arrow keys locally. -nam No auto-margin - suppress am capability. @@ -180,18 +179,18 @@ -w Wide; terminal is in 132 column mode. - Conventionally, if your terminal type is a variant intended to specify - a line height, that suffix should go first. So, for a hypothetical - FuBarCo model 2317 terminal in 30-line mode with reverse video, best + Conventionally, if your terminal type is a variant intended to specify + a line height, that suffix should go first. So, for a hypothetical + FuBarCo model 2317 terminal in 30-line mode with reverse video, best form would be fubar-30-rv (rather than, say, "fubar-rv-30"). - Terminal types that are written not as standalone entries, but rather - as components to be plugged into other entries via use capabilities, + Terminal types that are written not as standalone entries, but rather + as components to be plugged into other entries via use capabilities, are distinguished by using embedded plus signs rather than dashes. Commands which use a terminal type to control display often accept a -T - option that accepts a terminal name argument. Such programs should - fall back on the TERM environment variable when no -T option is speci- + option that accepts a terminal name argument. Such programs should + fall back on the TERM environment variable when no -T option is speci- fied. @@ -201,7 +200,7 @@

    FILES

    -       /usr/local/ncurses/lib/terminfo/?/*
    +       /usr/share/terminfo/?/*
                 compiled terminal capability data base
     
            /etc/inittab
    diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
    index 6c39ed6d..d0b50f37 100644
    --- a/doc/html/man/terminfo.5.html
    +++ b/doc/html/man/terminfo.5.html
    @@ -65,7 +65,7 @@
     
     
     

    SYNOPSIS

    -       /usr/local/ncurses/lib/terminfo/*/*
    +       /usr/share/terminfo/*/*
     
     
     

    DESCRIPTION

    @@ -74,7 +74,7 @@
            Terminfo describes terminals by giving a set of capabilities which they
            have, by specifying how to perform screen operations, and by specifying
            padding  requirements  and  initialization  sequences.   This describes
    -       ncurses version 6.0 (patch 20170819).
    +       ncurses version 6.0 (patch 20171007).
     
     
     

    Terminfo Entry Syntax

    @@ -1284,15 +1284,15 @@
     
                An  empty directory name (i.e., if the variable begins or ends with
                a colon, or contains adjacent colons) is interpreted as the  system
    -           location /usr/local/ncurses/lib/terminfo.
    +           location /usr/share/terminfo.
     
            o   Finally, ncurses searches these compiled-in locations:
     
                o   a    list    of    directories   (/usr/local/ncurses/share/ter-
                    minfo:/usr/share/terminfo), and
     
    -           o   the system terminfo directory,  /usr/local/ncurses/lib/terminfo
    -               (the compiled-in default).
    +           o   the system terminfo directory,  /usr/share/terminfo  (the  com-
    +               piled-in default).
     
     
     

    Preparing Descriptions

    @@ -2415,8 +2415,7 @@
     
     
     

    FILES

    -       /usr/local/ncurses/lib/terminfo/?/*
    -                                files containing terminal descriptions
    +       /usr/share/terminfo/?/*  files containing terminal descriptions
     
     
     

    SEE ALSO

    diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
    index 3f273d35..cd87c084 100644
    --- a/doc/html/man/tic.1m.html
    +++ b/doc/html/man/tic.1m.html
    @@ -79,20 +79,19 @@
            minfo" leaf, versus a "terminfo.db" file.
     
            The  results  are  normally  placed  in  the  system  terminfo database
    -       /usr/local/ncurses/lib/terminfo.  The compiled terminal description can
    -       be  placed  in  a  different  terminfo database.  There are two ways to
    -       achieve this:
    +       /usr/share/terminfo.  The compiled terminal description can  be  placed
    +       in a different terminfo database.  There are two ways to achieve this:
     
    -       o   First, you may override the system default either by using  the  -o
    -           option,  or by setting the variable TERMINFO in your shell environ-
    +       o   First,  you  may override the system default either by using the -o
    +           option, or by setting the variable TERMINFO in your shell  environ-
                ment to a valid database location.
     
    -       o   Secondly, if tic cannot write in /usr/local/ncurses/lib/terminfo or
    -           the  location  specified using your TERMINFO variable, it looks for
    -           the  directory  $HOME/.terminfo  (or  hashed  database  $HOME/.ter-
    -           minfo.db); if that location exists, the entry is placed there.
    +       o   Secondly,  if  tic cannot write in /usr/share/terminfo or the loca-
    +           tion specified using your  TERMINFO  variable,  it  looks  for  the
    +           directory  $HOME/.terminfo (or hashed database $HOME/.terminfo.db);
    +           if that location exists, the entry is placed there.
     
    -       Libraries  that  read terminfo entries are expected to check in succes-
    +       Libraries that read terminfo entries are expected to check  in  succes-
            sion
     
            o   a location specified with the TERMINFO environment variable,
    @@ -101,10 +100,10 @@
     
            o   directories listed in the TERMINFO_DIRS environment variable,
     
    -       o   a compiled-in list  of  directories  (/usr/local/ncurses/share/ter-
    +       o   a  compiled-in  list  of directories (/usr/local/ncurses/share/ter-
                minfo:/usr/share/terminfo), and
     
    -       o   the system terminfo database (/usr/local/ncurses/lib/terminfo).
    +       o   the system terminfo database (/usr/share/terminfo).
     
     
     

    OPTIONS

    @@ -112,41 +111,41 @@
     
            -1     restricts the output to a single column
     
    -       -a     tells  tic to retain commented-out capabilities rather than dis-
    +       -a     tells tic to retain commented-out capabilities rather than  dis-
                   carding them.  Capabilities are commented by prefixing them with
    -              a  period.   This sets the -x option, because it treats the com-
    -              mented-out entries as user-defined  names.   If  the  source  is
    -              termcap,  accept  the  2-character  names required by version 6.
    +              a period.  This sets the -x option, because it treats  the  com-
    +              mented-out  entries  as  user-defined  names.   If the source is
    +              termcap, accept the 2-character names  required  by  version  6.
                   Otherwise these are ignored.
     
    -       -C     Force source translation to termcap format.  Note: this  differs
    -              from  the  -C  option  of infocmp(1m) in that it does not merely
    +       -C     Force  source translation to termcap format.  Note: this differs
    +              from the -C option of infocmp(1m) in that  it  does  not  merely
                   translate capability names, but also translates terminfo strings
    -              to  termcap  format.  Capabilities that are not translatable are
    -              left in the entry under their terminfo names but  commented  out
    -              with  two  preceding  dots.  The actual format used incorporates
    -              some improvements for escaped characters from  terminfo  format.
    +              to termcap format.  Capabilities that are not  translatable  are
    +              left  in  the entry under their terminfo names but commented out
    +              with two preceding dots.  The actual  format  used  incorporates
    +              some  improvements  for escaped characters from terminfo format.
                   For a stricter BSD-compatible translation, add the -K option.
     
    -              If  this  is  combined  with  -c, tic makes additional checks to
    -              report cases where the terminfo values  do  not  have  an  exact
    +              If this is combined with -c,  tic  makes  additional  checks  to
    +              report  cases  where  the  terminfo  values do not have an exact
                   equivalent in termcap form.  For example:
     
    -              o   sgr  usually  will  not  convert,  because termcap lacks the
    -                  ability to work with more than two parameters,  and  because
    -                  termcap  lacks many of the arithmetic/logical operators used
    +              o   sgr usually will not  convert,  because  termcap  lacks  the
    +                  ability  to  work with more than two parameters, and because
    +                  termcap lacks many of the arithmetic/logical operators  used
                       in terminfo.
     
    -              o   capabilities with more than one delay or with delays  before
    +              o   capabilities  with more than one delay or with delays before
                       the end of the string will not convert completely.
     
    -       -c     tells  tic to only check file for errors, including syntax prob-
    -              lems and bad use links.   If  you  specify  -C  (-I)  with  this
    -              option,  the code will print warnings about entries which, after
    -              use resolution, are more than 1023 (4096) bytes long.  Due to  a
    +       -c     tells tic to only check file for errors, including syntax  prob-
    +              lems  and  bad  use  links.   If  you  specify -C (-I) with this
    +              option, the code will print warnings about entries which,  after
    +              use  resolution, are more than 1023 (4096) bytes long.  Due to a
                   fixed buffer length in older termcap libraries, as well as buggy
    -              checking for the buffer length (and a documented limit  in  ter-
    -              minfo),  these entries may cause core dumps with other implemen-
    +              checking  for  the buffer length (and a documented limit in ter-
    +              minfo), these entries may cause core dumps with other  implemen-
                   tations.
     
                   tic checks string capabilities to ensure that those with parame-
    @@ -154,29 +153,29 @@
                   predefined string capabilities; those which are defined with the
                   -x option are ignored.
     
    -       -D     tells  tic  to print the database locations that it knows about,
    +       -D     tells tic to print the database locations that it  knows  about,
                   and exit.  The first location shown is the one to which it would
    -              write  compiled  terminal  descriptions.   If tic is not able to
    -              find a writable database location according to the rules  summa-
    -              rized  above,  it will print a diagnostic and exit with an error
    +              write compiled terminal descriptions.  If tic  is  not  able  to
    +              find  a writable database location according to the rules summa-
    +              rized above, it will print a diagnostic and exit with  an  error
                   rather than printing a list of database locations.
     
            -e names
    -              Limit writes and translations to the  following  comma-separated
    -              list  of  terminals.  If any name or alias of a terminal matches
    -              one of the names in the list,  the  entry  will  be  written  or
    +              Limit  writes  and translations to the following comma-separated
    +              list of terminals.  If any name or alias of a  terminal  matches
    +              one  of  the  names  in  the  list, the entry will be written or
                   translated as normal.  Otherwise no output will be generated for
    -              it.  The option value is interpreted as a  file  containing  the
    +              it.   The  option  value is interpreted as a file containing the
                   list if it contains a '/'.  (Note: depending on how tic was com-
                   piled, this option may require -I or -C.)
     
    -       -f     Display    complex    terminfo     strings     which     contain
    +       -f     Display     complex     terminfo     strings    which    contain
                   if/then/else/endif expressions indented for readability.
     
    -       -G     Display  constant  literals  in  decimal  form rather than their
    +       -G     Display constant literals in  decimal  form  rather  than  their
                   character equivalents.
     
    -       -g     Display constant character literals in quoted form  rather  than
    +       -g     Display  constant  character literals in quoted form rather than
                   their decimal equivalents.
     
            -I     Force source translation to terminfo format.
    @@ -184,24 +183,24 @@
            -K     Suppress some longstanding ncurses extensions to termcap format,
                   e.g., "\s" for space.
     
    -       -L     Force source translation to terminfo format  using  the  long  C
    +       -L     Force  source  translation  to  terminfo format using the long C
                   variable names listed in <term.h>
     
            -N     Disable smart defaults.  Normally, when translating from termcap
    -              to terminfo, the compiler makes a number  of  assumptions  about
    -              the   defaults   of   string  capabilities  reset1_string,  car-
    +              to  terminfo,  the  compiler makes a number of assumptions about
    +              the  defaults  of  string   capabilities   reset1_string,   car-
                   riage_return,  cursor_left,  cursor_down,  scroll_forward,  tab,
                   newline, key_backspace, key_left, and key_down, then attempts to
    -              use obsolete termcap capabilities to deduce correct values.   It
    +              use  obsolete termcap capabilities to deduce correct values.  It
                   also normally suppresses output of obsolete termcap capabilities
    -              such as bs.  This option forces a more literal translation  that
    +              such  as bs.  This option forces a more literal translation that
                   also preserves the obsolete capabilities.
     
    -       -odir  Write  compiled  entries  to given database location.  Overrides
    +       -odir  Write compiled entries to given  database  location.   Overrides
                   the TERMINFO environment variable.
     
    -       -Qn    Rather than show source in terminfo  (text)  format,  print  the
    -              compiled  (binary) format in hexadecimal or base64 form, depend-
    +       -Qn    Rather  than  show  source  in terminfo (text) format, print the
    +              compiled (binary) format in hexadecimal or base64 form,  depend-
                   ing on the option's value:
     
                    1  hexadecimal
    @@ -214,35 +213,35 @@
                   source.
     
            -Rsubset
    -              Restrict  output to a given subset.  This option is for use with
    -              archaic versions of terminfo like  those  on  SVr1,  Ultrix,  or
    -              HP/UX  that  do not support the full set of SVR4/XSI Curses ter-
    -              minfo; and outright broken ports like AIX 3.x  that  have  their
    -              own  extensions  incompatible  with SVr4/XSI.  Available subsets
    +              Restrict output to a given subset.  This option is for use  with
    +              archaic  versions  of  terminfo  like  those on SVr1, Ultrix, or
    +              HP/UX that do not support the full set of SVR4/XSI  Curses  ter-
    +              minfo;  and  outright  broken ports like AIX 3.x that have their
    +              own extensions incompatible with  SVr4/XSI.   Available  subsets
                   are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see terminfo(5) for
                   details.
     
    -       -r     Force  entry  resolution (so there are no remaining tc capabili-
    -              ties) even when doing translation to termcap format.   This  may
    -              be  needed  if  you  are  preparing a termcap file for a termcap
    -              library (such as GNU termcap through version 1.3 or BSD  termcap
    -              through  4.3BSD)  that  does not handle multiple tc capabilities
    +       -r     Force entry resolution (so there are no remaining  tc  capabili-
    +              ties)  even  when doing translation to termcap format.  This may
    +              be needed if you are preparing a  termcap  file  for  a  termcap
    +              library  (such as GNU termcap through version 1.3 or BSD termcap
    +              through 4.3BSD) that does not handle  multiple  tc  capabilities
                   per entry.
     
    -       -s     Summarize the compile by  showing  the  database  location  into
    -              which  entries  are written, and the number of entries which are
    +       -s     Summarize  the  compile  by  showing  the database location into
    +              which entries are written, and the number of entries  which  are
                   compiled.
     
    -       -T     eliminates size-restrictions on the  generated  text.   This  is
    -              mainly  useful  for  testing  and  analysis,  since the compiled
    -              descriptions are limited (e.g., 1023 for termcap, 4096 for  ter-
    +       -T     eliminates  size-restrictions  on  the  generated text.  This is
    +              mainly useful for  testing  and  analysis,  since  the  compiled
    +              descriptions  are limited (e.g., 1023 for termcap, 4096 for ter-
                   minfo).
     
    -       -t     tells  tic to discard commented-out capabilities.  Normally when
    -              translating from terminfo to termcap,  untranslatable  capabili-
    +       -t     tells tic to discard commented-out capabilities.  Normally  when
    +              translating  from  terminfo to termcap, untranslatable capabili-
                   ties are commented-out.
     
    -       -U   tells  tic  to  not post-process the data after parsing the source
    +       -U   tells tic to not post-process the data after  parsing  the  source
                 file.  Normally, it infers data which is commonly missing in older
                 terminfo data, or in termcaps.
     
    @@ -252,9 +251,9 @@
            -vn  specifies that (verbose) output be written to standard error trace
                 information showing tic's progress.
     
    -            The  optional  parameter  n  is  a number from 1 to 10, inclusive,
    +            The optional parameter n is a number  from  1  to  10,  inclusive,
                 indicating the desired level of detail of information.  If ncurses
    -            is  built  without  tracing  support,  the  optional  parameter is
    +            is built  without  tracing  support,  the  optional  parameter  is
                 ignored.  If n is omitted, the default level is 1.  If n is speci-
                 fied and greater than 1, the level of detail is increased.
     
    @@ -276,88 +275,88 @@
     
                 If the debug level n is not given, it is taken to be one.
     
    -       -W   By  itself,  the  -w  option  will  not  force  long strings to be
    +       -W   By itself, the -w  option  will  not  force  long  strings  to  be
                 wrapped.  Use the -W option to do this.
     
    -            If you specify both -f and -W options, the latter is ignored  when
    +            If  you specify both -f and -W options, the latter is ignored when
                 -f has already split the line.
     
            -wn  specifies the width of the output.  The parameter is optional.  If
                 it is omitted, it defaults to 60.
     
    -       -x   Treat unknown capabilities as user-defined.  That is, if you  sup-
    -            ply  a capability name which tic does not recognize, it will infer
    -            its type (boolean, number or string) from the syntax and  make  an
    -            extended  table  entry  for that.  User-defined capability strings
    +       -x   Treat  unknown capabilities as user-defined.  That is, if you sup-
    +            ply a capability name which tic does not recognize, it will  infer
    +            its  type  (boolean, number or string) from the syntax and make an
    +            extended table entry for that.   User-defined  capability  strings
                 whose name begins with "k" are treated as function keys.
     
     
     

    PARAMETERS

    -       file   contains one or more terminfo terminal  descriptions  in  source
    -              format   [see   terminfo(5)].   Each  description  in  the  file
    +       file   contains  one  or  more terminfo terminal descriptions in source
    +              format  [see  terminfo(5)].   Each  description  in   the   file
                   describes the capabilities of a particular terminal.
     
    -              If file is "-", then the data is read from the  standard  input.
    +              If  file  is "-", then the data is read from the standard input.
                   The file parameter may also be the path of a character-device.
     
     
     

    PROCESSING

    -       All  but  one  of  the capabilities recognized by tic are documented in
    +       All but one of the capabilities recognized by  tic  are  documented  in
            terminfo(5).  The exception is the use capability.
     
            When a use=entry-name field is discovered in a terminal entry currently
    -       being     compiled,     tic     reads     in     the     binary    from
    -       /usr/local/ncurses/lib/terminfo to complete the entry.   (Entries  cre-
    -       ated  from file will be used first.  tic duplicates the capabilities in
    -       entry-name for the current entry, with the exception of those capabili-
    -       ties that explicitly are defined in the current entry.
    -
    -       When  an  entry, e.g., entry_name_1, contains a use=entry_name_2 field,
    -       any  canceled  capabilities  in  entry_name_2  must  also   appear   in
    -       entry_name_1  before  use=  for  these  capabilities  to be canceled in
    +       being compiled, tic reads in the  binary  from  /usr/share/terminfo  to
    +       complete  the  entry.   (Entries  created from file will be used first.
    +       tic duplicates the capabilities in entry-name for  the  current  entry,
    +       with the exception of those capabilities that explicitly are defined in
    +       the current entry.
    +
    +       When an entry, e.g., entry_name_1, contains a  use=entry_name_2  field,
    +       any   canceled   capabilities  in  entry_name_2  must  also  appear  in
    +       entry_name_1 before use= for  these  capabilities  to  be  canceled  in
            entry_name_1.
     
            Total compiled entries cannot exceed 4096 bytes.  The name field cannot
    -       exceed  512  bytes.   Terminal names exceeding the maximum alias length
    +       exceed 512 bytes.  Terminal names exceeding the  maximum  alias  length
            (32 characters on systems with long filenames, 14 characters otherwise)
    -       will  be  truncated  to  the maximum alias length and a warning message
    +       will be truncated to the maximum alias length  and  a  warning  message
            will be printed.
     
     
     

    COMPATIBILITY

    -       There is  some  evidence  that  historic  tic  implementations  treated
    -       description  fields with no whitespace in them as additional aliases or
    +       There  is  some  evidence  that  historic  tic  implementations treated
    +       description fields with no whitespace in them as additional aliases  or
            short names.  This tic does not do that, but it does warn when descrip-
    -       tion  fields may be treated that way and check them for dangerous char-
    +       tion fields may be treated that way and check them for dangerous  char-
            acters.
     
     
     

    EXTENSIONS

    -       Unlike the SVr4 tic command, this implementation can  actually  compile
    -       termcap  sources.   In fact, entries in terminfo and termcap syntax can
    -       be mixed in a single source file.  See  terminfo(5)  for  the  list  of
    +       Unlike  the  SVr4 tic command, this implementation can actually compile
    +       termcap sources.  In fact, entries in terminfo and termcap  syntax  can
    +       be  mixed  in  a  single  source file.  See terminfo(5) for the list of
            termcap names taken to be equivalent to terminfo names.
     
    -       The  SVr4  manual  pages  are not clear on the resolution rules for use
    -       capabilities.  This implementation of tic will find  use  targets  any-
    -       where  in  the source file, or anywhere in the file tree rooted at TER-
    -       MINFO (if TERMINFO is defined), or in the user's $HOME/.terminfo  data-
    +       The SVr4 manual pages are not clear on the  resolution  rules  for  use
    +       capabilities.   This  implementation  of tic will find use targets any-
    +       where in the source file, or anywhere in the file tree rooted  at  TER-
    +       MINFO  (if TERMINFO is defined), or in the user's $HOME/.terminfo data-
            base (if it exists), or (finally) anywhere in the system's file tree of
            compiled entries.
     
    -       The error messages from this tic have the same format as  GNU  C  error
    +       The  error  messages  from this tic have the same format as GNU C error
            messages, and can be parsed by GNU Emacs's compile facility.
     
    -       The  -0, -1, -C, -G, -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r, -s, -t
    +       The -0, -1, -C, -G, -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r, -s,  -t
            and -x options are not supported under SVr4.  The SVr4 -c mode does not
            report bad use links.
     
    -       System  V  does  not  compile  entries  to  or  read  entries from your
    +       System V does  not  compile  entries  to  or  read  entries  from  your
            $HOME/.terminfo database unless TERMINFO is explicitly set to it.
     
     
     

    FILES

    -       /usr/local/ncurses/lib/terminfo/?/*
    +       /usr/share/terminfo/?/*
                 Compiled terminal description database.
     
     
    @@ -365,7 +364,7 @@
            infocmp(1m),   captoinfo(1m),   infotocap(1m),   toe(1m),   curses(3x),
            term(5).  terminfo(5).
     
    -       This describes ncurses version 6.0 (patch 20170819).
    +       This describes ncurses version 6.0 (patch 20171007).
     
     
     

    AUTHOR

    diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
    index 7cbcb508..7c807035 100644
    --- a/doc/html/man/toe.1m.html
    +++ b/doc/html/man/toe.1m.html
    @@ -105,7 +105,7 @@
     
     
     

    FILES

    -       /usr/local/ncurses/lib/terminfo/?/*
    +       /usr/share/terminfo/?/*
                 Compiled terminal description database.
     
     
    @@ -113,7 +113,7 @@
            tic(1m), infocmp(1m), captoinfo(1m),  infotocap(1m),  curses(3x),  ter-
            minfo(5).
     
    -       This describes ncurses version 6.0 (patch 20170819).
    +       This describes ncurses version 6.0 (patch 20171007).
     
     
     
    diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
    index 1de0239a..eafd4ba3 100644
    --- a/doc/html/man/tput.1.html
    +++ b/doc/html/man/tput.1.html
    @@ -304,7 +304,7 @@
     
     
     

    FILES

    -       /usr/local/ncurses/lib/terminfo
    +       /usr/share/terminfo
                   compiled terminal description database
     
            /usr/share/tabset/*
    @@ -482,7 +482,7 @@
     

    SEE ALSO

            clear(1), stty(1), tabs(1), tset(1), terminfo(5), curs_termcap(3x).
     
    -       This describes ncurses version 6.0 (patch 20170819).
    +       This describes ncurses version 6.0 (patch 20171007).
     
     
     
    diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
    index 0dcd6195..d49ef9e5 100644
    --- a/doc/html/man/tset.1.html
    +++ b/doc/html/man/tset.1.html
    @@ -381,7 +381,7 @@
                 system  port  name to terminal type mapping database (BSD versions
                 only).
     
    -       /usr/local/ncurses/lib/terminfo
    +       /usr/share/terminfo
                 terminal capability database
     
     
    @@ -389,7 +389,7 @@
            csh(1),  sh(1),  stty(1),   curs_terminfo(3x),   tty(4),   terminfo(5),
            ttys(5), environ(7)
     
    -       This describes ncurses version 6.0 (patch 20170819).
    +       This describes ncurses version 6.0 (patch 20171007).
     
     
     
    diff --git a/doc/html/man/user_caps.5.html b/doc/html/man/user_caps.5.html
    index 92a8249a..5dcaa9e4 100644
    --- a/doc/html/man/user_caps.5.html
    +++ b/doc/html/man/user_caps.5.html
    @@ -26,7 +26,7 @@
       * sale, use or other dealings in this Software without prior written       *
       * authorization.                                                           *
       ****************************************************************************
    -  * @Id: user_caps.5,v 1.1 2017/08/12 21:26:12 tom Exp @
    +  * @Id: user_caps.5,v 1.2 2017/09/04 19:27:24 tom Exp @
     -->
     
     
    @@ -198,7 +198,7 @@
                  drawing characters, and that it should ignore the alternate char-
                  acter  set capabilities when the locale uses UTF-8 encoding.  For
                  more information, see the discussion  of  NCURSES_NO_UTF8_ACS  in
    -             terminfo(5).
    +             ncurses(3x).
     
                  Set this capability to a nonzero value to enable it.
     
    diff --git a/man/clear.1 b/man/clear.1
    index 3d2ffd98..16914dbb 100644
    --- a/man/clear.1
    +++ b/man/clear.1
    @@ -26,7 +26,7 @@
     .\" authorization.                                                           *
     .\"***************************************************************************
     .\"
    -.\" $Id: clear.1,v 1.17 2017/08/19 14:12:50 tom Exp $
    +.\" $Id: clear.1,v 1.18 2017/10/07 21:30:17 tom Exp $
     .TH @CLEAR@ 1 ""
     .\" these would be fallbacks for DS/DE,
     .\" but groff changed the meaning of the macros.
    @@ -76,6 +76,8 @@ indicates the \fItype\fR of terminal.
     Normally this option is
     unnecessary, because the default is taken from the environment
     variable \fBTERM\fR.
    +If \fB\-T\fR is specified, then the shell
    +variables \fBLINES\fR and \fBCOLUMNS\fR will also be ignored.
     .TP
     .B \-V
     reports the version of ncurses which was used in this program, and exits.
    diff --git a/man/curs_util.3x b/man/curs_util.3x
    index 8833612b..6901dd7a 100644
    --- a/man/curs_util.3x
    +++ b/man/curs_util.3x
    @@ -27,7 +27,7 @@
     .\" authorization.                                                           *
     .\"***************************************************************************
     .\"
    -.\" $Id: curs_util.3x,v 1.50 2017/09/10 21:20:35 tom Exp $
    +.\" $Id: curs_util.3x,v 1.51 2017/10/07 21:47:25 tom Exp $
     .TH curs_util 3X ""
     .ie \n(.g .ds `` \(lq
     .el       .ds `` ``
    @@ -161,7 +161,7 @@ Normally \fBncurses\fP looks first at the terminal database for the screen size.
     .IP
     If \fBuse_env\fP was called with \fBFALSE\fP for parameter,
     it stops here unless
    -If \fBuse_tioctl\fP was also called with \fBTRUE\fP for parameter.
    +\fBuse_tioctl\fP was also called with \fBTRUE\fP for parameter.
     .bP
     Then it asks for the screen size via operating system calls.
     If successful,
    diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog
    index dd792386..cf73ff7e 100644
    --- a/package/debian-mingw/changelog
    +++ b/package/debian-mingw/changelog
    @@ -1,8 +1,8 @@
    -ncurses6 (6.0+20170930) unstable; urgency=low
    +ncurses6 (6.0+20171007) unstable; urgency=low
     
       * latest weekly patch
     
    - -- Thomas E. Dickey   Thu, 28 Sep 2017 04:10:01 -0400
    + -- Thomas E. Dickey   Sun, 01 Oct 2017 21:01:40 -0400
     
     ncurses6 (5.9-20131005) unstable; urgency=low
     
    diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog
    index dd792386..cf73ff7e 100644
    --- a/package/debian-mingw64/changelog
    +++ b/package/debian-mingw64/changelog
    @@ -1,8 +1,8 @@
    -ncurses6 (6.0+20170930) unstable; urgency=low
    +ncurses6 (6.0+20171007) unstable; urgency=low
     
       * latest weekly patch
     
    - -- Thomas E. Dickey   Thu, 28 Sep 2017 04:10:01 -0400
    + -- Thomas E. Dickey   Sun, 01 Oct 2017 21:01:40 -0400
     
     ncurses6 (5.9-20131005) unstable; urgency=low
     
    diff --git a/package/debian/changelog b/package/debian/changelog
    index d65c240c..086ea2b2 100644
    --- a/package/debian/changelog
    +++ b/package/debian/changelog
    @@ -1,8 +1,8 @@
    -ncurses6 (6.0+20170930) unstable; urgency=low
    +ncurses6 (6.0+20171007) unstable; urgency=low
     
       * latest weekly patch
     
    - -- Thomas E. Dickey   Thu, 28 Sep 2017 04:10:01 -0400
    + -- Thomas E. Dickey   Sun, 01 Oct 2017 21:01:40 -0400
     
     ncurses6 (5.9-20120608) unstable; urgency=low
     
    diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi
    index 2a3747d8..7992e15d 100644
    --- a/package/mingw-ncurses.nsi
    +++ b/package/mingw-ncurses.nsi
    @@ -1,4 +1,4 @@
    -; $Id: mingw-ncurses.nsi,v 1.233 2017/09/28 08:10:00 tom Exp $
    +; $Id: mingw-ncurses.nsi,v 1.234 2017/10/02 01:01:40 tom Exp $
     
     ; TODO add examples
     ; TODO bump ABI to 6
    @@ -10,7 +10,7 @@
     !define VERSION_MAJOR "6"
     !define VERSION_MINOR "0"
     !define VERSION_YYYY  "2017"
    -!define VERSION_MMDD  "0930"
    +!define VERSION_MMDD  "1007"
     !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
     
     !define MY_ABI   "5"
    diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec
    index 01bc163f..d86b3153 100644
    --- a/package/mingw-ncurses.spec
    +++ b/package/mingw-ncurses.spec
    @@ -3,7 +3,7 @@
     Summary: shared libraries for terminal handling
     Name: mingw32-ncurses6
     Version: 6.0
    -Release: 20170930
    +Release: 20171007
     License: X11
     Group: Development/Libraries
     Source: ncurses-%{version}-%{release}.tgz
    diff --git a/package/ncurses.spec b/package/ncurses.spec
    index 97079f60..9ec39c8e 100644
    --- a/package/ncurses.spec
    +++ b/package/ncurses.spec
    @@ -1,7 +1,7 @@
     Summary: shared libraries for terminal handling
     Name: ncurses6
     Version: 6.0
    -Release: 20170930
    +Release: 20171007
     License: X11
     Group: Development/Libraries
     Source: ncurses-%{version}-%{release}.tgz
    diff --git a/progs/clear.c b/progs/clear.c
    index 7eac9b1e..2ffdf953 100644
    --- a/progs/clear.c
    +++ b/progs/clear.c
    @@ -40,7 +40,7 @@
     #include 
     #include 
     
    -MODULE_ID("$Id: clear.c,v 1.19 2017/08/19 13:40:22 tom Exp $")
    +MODULE_ID("$Id: clear.c,v 1.22 2017/10/07 21:48:32 tom Exp $")
     
     const char *_nc_progname = "clear";
     
    @@ -80,6 +80,7 @@ main(
     	switch (c) {
     	case 'T':
     	    use_env(FALSE);
    +	    use_tioctl(TRUE);
     	    term = optarg;
     	    break;
     	case 'V':
    @@ -96,7 +97,7 @@ main(
         if (optind < argc)
     	usage();
     
    -    fd = save_tty_settings(&tty_settings);
    +    fd = save_tty_settings(&tty_settings, FALSE);
     
         setupterm(term, fd, (int *) 0);
     
    diff --git a/progs/clear_cmd.c b/progs/clear_cmd.c
    index 0e1d85f5..68a02164 100644
    --- a/progs/clear_cmd.c
    +++ b/progs/clear_cmd.c
    @@ -37,7 +37,7 @@
     #define USE_LIBTINFO
     #include 
     
    -MODULE_ID("$Id: clear_cmd.c,v 1.2 2017/08/19 13:37:24 tom Exp $")
    +MODULE_ID("$Id: clear_cmd.c,v 1.3 2017/10/08 00:04:26 tom Exp $")
     
     static int
     putch(int c)
    @@ -48,11 +48,9 @@ putch(int c)
     int
     clear_cmd(bool legacy)
     {
    -    char *E3;
    -
         if (!legacy) {
     	/* Clear the scrollback buffer if possible. */
    -	E3 = tigetstr("E3");
    +	char *E3 = tigetstr("E3");
     	if (E3)
     	    (void) tputs(E3, lines > 0 ? lines : 1, putch);
         }
    diff --git a/progs/progs.priv.h b/progs/progs.priv.h
    index e621bcdd..4b1b5381 100644
    --- a/progs/progs.priv.h
    +++ b/progs/progs.priv.h
    @@ -30,7 +30,7 @@
      *  Author: Thomas E. Dickey                    1997-on                     *
      ****************************************************************************/
     /*
    - * $Id: progs.priv.h,v 1.44 2017/07/15 18:26:07 tom Exp $
    + * $Id: progs.priv.h,v 1.45 2017/10/07 20:42:10 tom Exp $
      *
      *	progs.priv.h
      *
    @@ -138,6 +138,12 @@ extern int optind;
     #endif
     #endif
     
    +/* error-returns for tput */
    +#define ErrUsage	2
    +#define ErrTermType	3
    +#define ErrCapName	4
    +#define ErrSystem(n)	(4 + (n))
    +
     #if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
     #define IGNORE_RC(func) errno = (int) func
     #else
    diff --git a/progs/reset_cmd.c b/progs/reset_cmd.c
    index 4d05c6e9..a4e44efc 100644
    --- a/progs/reset_cmd.c
    +++ b/progs/reset_cmd.c
    @@ -52,7 +52,7 @@
     #include 
     #endif
     
    -MODULE_ID("$Id: reset_cmd.c,v 1.12 2017/09/20 00:49:25 tom Exp $")
    +MODULE_ID("$Id: reset_cmd.c,v 1.13 2017/10/07 20:56:03 tom Exp $")
     
     /*
      * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
    @@ -80,25 +80,15 @@ static bool use_reset = FALSE;	/* invoked as reset */
     static bool use_init = FALSE;	/* invoked as init */
     
     static void
    -exit_error(void)
    +failed(const char *msg)
     {
    +    int code = errno;
    +
    +    (void) fprintf(stderr, "%s: %s: %s\n", _nc_progname, msg, strerror(code));
         restore_tty_settings();
         (void) fprintf(my_file, "\n");
         fflush(my_file);
    -    ExitProgram(EXIT_FAILURE);
    -    /* NOTREACHED */
    -}
    -
    -static void
    -failed(const char *msg)
    -{
    -    char temp[BUFSIZ];
    -
    -    _nc_STRCPY(temp, _nc_progname, sizeof(temp));
    -    _nc_STRCAT(temp, ": ", sizeof(temp));
    -    _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
    -    perror(temp);
    -    exit_error();
    +    ExitProgram(ErrSystem(code));
         /* NOTREACHED */
     }
     
    diff --git a/progs/tabs.c b/progs/tabs.c
    index d7877baf..7e2d12df 100644
    --- a/progs/tabs.c
    +++ b/progs/tabs.c
    @@ -1,5 +1,5 @@
     /****************************************************************************
    - * Copyright (c) 2008-2015,2016 Free Software Foundation, Inc.              *
    + * Copyright (c) 2008-2016,2017 Free Software Foundation, Inc.              *
      *                                                                          *
      * Permission is hereby granted, free of charge, to any person obtaining a  *
      * copy of this software and associated documentation files (the            *
    @@ -38,7 +38,7 @@
     #include 
     #include 
     
    -MODULE_ID("$Id: tabs.c,v 1.38 2016/12/31 15:10:52 tom Exp $")
    +MODULE_ID("$Id: tabs.c,v 1.40 2017/10/07 19:34:58 tom Exp $")
     
     static void usage(void) GCC_NORETURN;
     
    @@ -387,7 +387,7 @@ main(int argc, char *argv[])
     
         _nc_progname = _nc_rootname(argv[0]);
     
    -    fd = save_tty_settings(&tty_settings);
    +    fd = save_tty_settings(&tty_settings, FALSE);
     
         if ((term_name = getenv("TERM")) == 0)
     	term_name = "ansi+tabs";
    diff --git a/progs/tput.c b/progs/tput.c
    index 3295d18e..76370cbc 100644
    --- a/progs/tput.c
    +++ b/progs/tput.c
    @@ -50,7 +50,7 @@
     #include 
     #include 
     
    -MODULE_ID("$Id: tput.c,v 1.72 2017/09/02 21:03:26 tom Exp $")
    +MODULE_ID("$Id: tput.c,v 1.77 2017/10/07 23:51:01 tom Exp $")
     
     #define PUTS(s)		fputs(s, stdout)
     
    @@ -96,7 +96,7 @@ usage(void)
     #undef KEEP
         (void) fprintf(stderr, "Usage: %s [options] [command]\n", prg_name);
         fputs(msg, stderr);
    -    ExitProgram(EXIT_FAILURE);
    +    ExitProgram(ErrUsage);
     }
     
     static char *
    @@ -135,6 +135,9 @@ exit_code(int token, int value)
         return result;
     }
     
    +/*
    + * Returns nonzero on error.
    + */
     static int
     tput_cmd(int fd, TTY * saved_settings, bool opt_x, int argc, char *argv[])
     {
    @@ -183,7 +186,7 @@ tput_cmd(int fd, TTY * saved_settings, bool opt_x, int argc, char *argv[])
       retry:
     #endif
         if (strcmp(name, "clear") == 0) {
    -	return clear_cmd(opt_x);
    +	return (clear_cmd(opt_x) == ERR) ? ErrUsage : 0;
         } else if ((status = tigetflag(name)) != -1) {
     	return exit_code(BOOLEAN, status);
         } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) {
    @@ -213,7 +216,7 @@ tput_cmd(int fd, TTY * saved_settings, bool opt_x, int argc, char *argv[])
     	    }
     	}
     #endif
    -	quit(4, "unknown terminfo capability '%s'", name);
    +	quit(ErrCapName, "unknown terminfo capability '%s'", name);
         } else if (VALID_STRING(s)) {
     	if (argc > 1) {
     	    int k;
    @@ -283,6 +286,8 @@ main(int argc, char **argv)
         int fd;
         TTY tty_settings;
         bool opt_x = FALSE;		/* clear scrollback if possible */
    +    bool is_alias;
    +    bool need_tty;
     
         prg_name = check_aliases(_nc_rootname(argv[0]), TRUE);
     
    @@ -295,6 +300,7 @@ main(int argc, char **argv)
     	    break;
     	case 'T':
     	    use_env(FALSE);
    +	    use_tioctl(TRUE);
     	    term = optarg;
     	    break;
     	case 'V':
    @@ -309,10 +315,13 @@ main(int argc, char **argv)
     	}
         }
     
    +    is_alias = (is_clear || is_reset || is_init);
    +    need_tty = (is_reset || is_init);
    +
         /*
          * Modify the argument list to omit the options we processed.
          */
    -    if (is_clear || is_reset || is_init) {
    +    if (is_alias) {
     	if (optind-- < argc) {
     	    argc -= optind;
     	    argv += optind;
    @@ -324,15 +333,15 @@ main(int argc, char **argv)
         }
     
         if (term == 0 || *term == '\0')
    -	quit(2, "No value for $TERM and no -T specified");
    +	quit(ErrUsage, "No value for $TERM and no -T specified");
     
    -    fd = save_tty_settings(&tty_settings);
    +    fd = save_tty_settings(&tty_settings, need_tty);
     
         if (setupterm(term, fd, &errret) != OK && errret <= 0)
    -	quit(3, "unknown terminal \"%s\"", term);
    +	quit(ErrTermType, "unknown terminal \"%s\"", term);
     
         if (cmdline) {
    -	if ((argc <= 0) && !(is_clear || is_reset || is_init))
    +	if ((argc <= 0) && !is_alias)
     	    usage();
     	ExitProgram(tput_cmd(fd, &tty_settings, opt_x, argc, argv));
         }
    @@ -357,7 +366,7 @@ main(int argc, char **argv)
     	if (argnum != 0
     	    && tput_cmd(fd, &tty_settings, opt_x, argnum, argvec) != 0) {
     	    if (result == 0)
    -		result = 4;	/* will return value >4 */
    +		result = ErrSystem(0);	/* will return value >4 */
     	    ++result;
     	}
         }
    diff --git a/progs/tset.c b/progs/tset.c
    index 8fb5be72..10696e9d 100644
    --- a/progs/tset.c
    +++ b/progs/tset.c
    @@ -97,7 +97,7 @@
     char *ttyname(int fd);
     #endif
     
    -MODULE_ID("$Id: tset.c,v 1.118 2017/08/19 13:16:03 tom Exp $")
    +MODULE_ID("$Id: tset.c,v 1.120 2017/10/08 00:01:29 tom Exp $")
     
     #ifndef environ
     extern char **environ;
    @@ -760,7 +760,7 @@ main(int argc, char **argv)
         int terasechar = -1;	/* new erase character */
         int intrchar = -1;		/* new interrupt character */
         int tkillchar = -1;		/* new kill character */
    -    int my_fd = -1;
    +    int my_fd;
         bool opt_c = FALSE;		/* set control-chars */
         bool opt_w = FALSE;		/* set window-size */
         TTY mode, oldmode;
    @@ -834,7 +834,7 @@ main(int argc, char **argv)
         if (!opt_c && !opt_w)
     	opt_c = opt_w = TRUE;
     
    -    my_fd = save_tty_settings(&mode);
    +    my_fd = save_tty_settings(&mode, TRUE);
         oldmode = mode;
     #ifdef TERMIOS
         ospeed = (NCURSES_OSPEED) cfgetospeed(&mode);
    diff --git a/progs/tty_settings.c b/progs/tty_settings.c
    index 93d9e2ab..23daefa0 100644
    --- a/progs/tty_settings.c
    +++ b/progs/tty_settings.c
    @@ -1,5 +1,5 @@
     /****************************************************************************
    - * Copyright (c) 2016 Free Software Foundation, Inc.                        *
    + * Copyright (c) 2016,2017 Free Software Foundation, Inc.                   *
      *                                                                          *
      * Permission is hereby granted, free of charge, to any person obtaining a  *
      * copy of this software and associated documentation files (the            *
    @@ -35,31 +35,21 @@
     
     #include 
     
    -MODULE_ID("$Id: tty_settings.c,v 1.2 2016/12/24 19:31:11 tom Exp $")
    +MODULE_ID("$Id: tty_settings.c,v 1.5 2017/10/07 20:55:57 tom Exp $")
     
     static int my_fd;
     static TTY original_settings;
     static bool can_restore = FALSE;
     
    -static void
    -exit_error(void)
    -{
    -    restore_tty_settings();
    -    (void) fprintf(stderr, "\n");
    -    ExitProgram(EXIT_FAILURE);
    -    /* NOTREACHED */
    -}
    -
     static void
     failed(const char *msg)
     {
    -    char temp[BUFSIZ];
    +    int code = errno;
     
    -    _nc_STRCPY(temp, _nc_progname, sizeof(temp));
    -    _nc_STRCAT(temp, ": ", sizeof(temp));
    -    _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
    -    perror(temp);
    -    exit_error();
    +    (void) fprintf(stderr, "%s: %s: %s\n", _nc_progname, msg, strerror(code));
    +    restore_tty_settings();
    +    (void) fprintf(stderr, "\n");
    +    ExitProgram(ErrSystem(code));
         /* NOTREACHED */
     }
     
    @@ -79,16 +69,21 @@ get_tty_settings(int fd, TTY * tty_settings)
      * stderr is less likely to be redirected than stdout; try that first.
      */
     int
    -save_tty_settings(TTY * tty_settings)
    +save_tty_settings(TTY * tty_settings, bool need_tty)
     {
         if (!get_tty_settings(STDERR_FILENO, tty_settings) &&
     	!get_tty_settings(STDOUT_FILENO, tty_settings) &&
     	!get_tty_settings(STDIN_FILENO, tty_settings) &&
     	!get_tty_settings(open("/dev/tty", O_RDWR), tty_settings)) {
    -	failed("terminal attributes");
    +	if (need_tty) {
    +	    failed("terminal attributes");
    +	} else {
    +	    my_fd = fileno(stdout);
    +	}
    +    } else {
    +	can_restore = TRUE;
    +	original_settings = *tty_settings;
         }
    -    can_restore = TRUE;
    -    original_settings = *tty_settings;
         return my_fd;
     }
     
    diff --git a/progs/tty_settings.h b/progs/tty_settings.h
    index 1104291e..b0731078 100644
    --- a/progs/tty_settings.h
    +++ b/progs/tty_settings.h
    @@ -1,5 +1,5 @@
     /****************************************************************************
    - * Copyright (c) 2016 Free Software Foundation, Inc.                        *
    + * Copyright (c) 2016,2017 Free Software Foundation, Inc.                   *
      *                                                                          *
      * Permission is hereby granted, free of charge, to any person obtaining a  *
      * copy of this software and associated documentation files (the            *
    @@ -31,7 +31,7 @@
      ****************************************************************************/
     
     /*
    - * $Id: tty_settings.h,v 1.1 2016/12/24 18:17:44 tom Exp $
    + * $Id: tty_settings.h,v 1.2 2017/10/07 19:11:31 tom Exp $
      *
      * Utility functions for saving/restoring terminal settings.
      */
    @@ -41,7 +41,7 @@
     
     #include 
     
    -extern int save_tty_settings(TTY * /* tty_settings */ );
    +extern int save_tty_settings(TTY * /* tty_settings */, bool /* need_tty */ );
     extern void restore_tty_settings(void);
     extern void update_tty_settings(TTY * /* old_settings */, TTY * /* new_settings */ );
     
    diff --git a/test/ncurses.c b/test/ncurses.c
    index 8e75a200..c1ed6ca7 100644
    --- a/test/ncurses.c
    +++ b/test/ncurses.c
    @@ -40,7 +40,7 @@ AUTHOR
        Author: Eric S. Raymond  1993
                Thomas E. Dickey (beginning revision 1.27 in 1996).
     
    -$Id: ncurses.c,v 1.468 2017/10/01 00:14:01 tom Exp $
    +$Id: ncurses.c,v 1.469 2017/10/01 18:22:48 tom Exp $
     
     ***************************************************************************/
     
    @@ -221,7 +221,7 @@ wGetchar(WINDOW *win)
     }
     #define Getchar() wGetchar(stdscr)
     
    -#if HAVE_SLK_COLOR
    +#if USE_SOFTKEYS
     /* replaces wgetnstr(), since we want to be able to edit values */
     static void
     wGetstring(WINDOW *win, char *buffer, int limit)
    diff --git a/test/test_arrays.c b/test/test_arrays.c
    index 117c249e..f051a815 100644
    --- a/test/test_arrays.c
    +++ b/test/test_arrays.c
    @@ -1,5 +1,5 @@
     /****************************************************************************
    - * Copyright (c) 2007-2008,2010 Free Software Foundation, Inc.              *
    + * Copyright (c) 2007-2010,2017 Free Software Foundation, Inc.              *
      *                                                                          *
      * Permission is hereby granted, free of charge, to any person obtaining a  *
      * copy of this software and associated documentation files (the            *
    @@ -26,7 +26,7 @@
      * authorization.                                                           *
      ****************************************************************************/
     /*
    - * $Id: test_arrays.c,v 1.7 2017/09/20 00:21:22 tom Exp $
    + * $Id: test_arrays.c,v 1.8 2017/10/07 23:55:21 tom Exp $
      *
      * Author: Thomas E Dickey
      *