From f06e14af5e11df95d6542964bf1b349d2843bb11 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 23 Oct 2016 01:59:31 +0000 Subject: [PATCH] ncurses 6.0 - patch 20161022 + modify tset -w (and tput reset) to update the program's copy of the screensize if it was already set in the system, to improve tabstop setting which relies upon knowing the actual screensize. + add functionality of tset -w to tput, like the "-c" feature this is not optional in tput. + add "clear" as a possible link/alias to tput. + improve tput's check for being called as "init" or "reset" to allow for transformed names. + split-out the "clear" function from progs/clear.c, share with tput to get the same behavior, e.g., the E3 extension. --- MANIFEST | 6 +- NEWS | 14 +- VERSION | 2 +- dist.mk | 4 +- ...config.1.html => adacurses6-config.1.html} | 23 +- doc/html/man/captoinfo.1m.html | 2 +- doc/html/man/clear.1.html | 2 +- doc/html/man/curs_inopts.3x.html | 4 +- doc/html/man/form.3x.html | 2 +- doc/html/man/infocmp.1m.html | 8 +- doc/html/man/infotocap.1m.html | 2 +- doc/html/man/menu.3x.html | 2 +- doc/html/man/ncurses.3x.html | 2 +- ...5-config.1.html => ncurses6-config.1.html} | 29 +-- doc/html/man/panel.3x.html | 2 +- doc/html/man/tabs.1.html | 6 +- doc/html/man/term.5.html | 2 +- doc/html/man/terminfo.5.html | 8 +- doc/html/man/tic.1m.html | 2 +- doc/html/man/toe.1m.html | 2 +- doc/html/man/tput.1.html | 207 +++++++++--------- doc/html/man/tset.1.html | 2 +- man/curs_inopts.3x | 4 +- man/infocmp.1m | 6 +- man/tabs.1 | 4 +- man/term.5 | 8 +- man/terminfo.tail | 9 +- man/tput.1 | 29 ++- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- progs/Makefile.in | 8 +- progs/clear.c | 23 +- progs/clear_cmd.c | 59 +++++ progs/clear_cmd.h | 44 ++++ progs/modules | 3 +- progs/reset_cmd.c | 24 +- progs/reset_cmd.h | 4 +- progs/tput.c | 43 ++-- progs/tset.c | 4 +- 43 files changed, 375 insertions(+), 250 deletions(-) rename doc/html/man/{adacurses-config.1.html => adacurses6-config.1.html} (92%) rename doc/html/man/{ncurses5-config.1.html => ncurses6-config.1.html} (87%) create mode 100644 progs/clear_cmd.c create mode 100644 progs/clear_cmd.h diff --git a/MANIFEST b/MANIFEST index a038ad63..032e0ee8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -342,7 +342,7 @@ ./doc/html/announce.html ./doc/html/hackguide.html ./doc/html/index.html -./doc/html/man/adacurses-config.1.html +./doc/html/man/adacurses6-config.1.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html ./doc/html/man/curs_add_wch.3x.html @@ -463,7 +463,7 @@ ./doc/html/man/mitem_value.3x.html ./doc/html/man/mitem_visible.3x.html ./doc/html/man/ncurses.3x.html -./doc/html/man/ncurses5-config.1.html +./doc/html/man/ncurses6-config.1.html ./doc/html/man/panel.3x.html ./doc/html/man/resizeterm.3x.html ./doc/html/man/tabs.1.html @@ -1047,6 +1047,8 @@ ./progs/capconvert ./progs/clear.c ./progs/clear.sh +./progs/clear_cmd.c +./progs/clear_cmd.h ./progs/dump_entry.c ./progs/dump_entry.h ./progs/infocmp.c diff --git a/NEWS b/NEWS index a53b691a..1a669b3d 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.2682 2016/10/15 23:26:53 tom Exp $ +-- $Id: NEWS,v 1.2687 2016/10/23 00:03:47 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. +20161022 + + modify tset -w (and tput reset) to update the program's copy of the + screensize if it was already set in the system, to improve tabstop + setting which relies upon knowing the actual screensize. + + add functionality of tset -w to tput, like the "-c" feature this is + not optional in tput. + + add "clear" as a possible link/alias to tput. + + improve tput's check for being called as "init" or "reset" to allow + for transformed names. + + split-out the "clear" function from progs/clear.c, share with + tput to get the same behavior, e.g., the E3 extension. + 20161015 + amend internal use of tputs to consistently use the number of lines affected, e.g., for insert/delete character operations. While diff --git a/VERSION b/VERSION index 906b2f6c..0290d6db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20161015 +5:0:9 6.0 20161022 diff --git a/dist.mk b/dist.mk index c3670a66..3d5cc4d7 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.1128 2016/10/15 15:43:49 tom Exp $ +# $Id: dist.mk,v 1.1129 2016/10/21 22:47:18 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 = 20161015 +NCURSES_PATCH = 20161022 # 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/adacurses-config.1.html b/doc/html/man/adacurses6-config.1.html similarity index 92% rename from doc/html/man/adacurses-config.1.html rename to doc/html/man/adacurses6-config.1.html index 213771c1..1778d7be 100644 --- a/doc/html/man/adacurses-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -38,33 +38,28 @@ -

ADACURSES 1 User Commands

-
+

ADACURSES 1 User Commands

 ADACURSES(1)                 User Commands                 ADACURSES(1)
 
 
 
 
-
-

NAME

+

NAME

        adacurses-config - helper script for AdaCurses libraries
 
 
-
-

SYNOPSIS

+

SYNOPSIS

        adacurses-config [options]
 
 
-
-

DESCRIPTION

+

DESCRIPTION

        This  is  a  shell  script which simplifies configuring an
        application  to  use  the  AdaCurses  library  binding  to
        ncurses.
 
 
-
-

OPTIONS

+

OPTIONS

        --cflags
               echos  the gnat (Ada compiler) flags needed to com-
               pile with AdaCurses.
@@ -84,8 +79,7 @@
        example).
 
 
-
-

EXAMPLE

+

EXAMPLE

        For example, supposing that you want to compile the "Hello
        World!"   program  for  AdaCurses.   Make  a  file   named
        "hello.adb":
@@ -134,11 +128,10 @@
        you will compile and link the program.
 
 
-
-

SEE ALSO

+

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 5.9 (patch 20150215).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 7665785b..aa86b59d 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -198,7 +198,7 @@
 

SEE ALSO

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

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index 484a59c7..e1a9e3b3 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -67,7 +67,7 @@
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/curs_inopts.3x.html b/doc/html/man/curs_inopts.3x.html
index eacf7034..c22be9da 100644
--- a/doc/html/man/curs_inopts.3x.html
+++ b/doc/html/man/curs_inopts.3x.html
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inopts.3x,v 1.22 2016/10/15 17:13:45 tom Exp @
+  * @Id: curs_inopts.3x,v 1.23 2016/10/22 19:54:35 tom Exp @
 -->
 
 
@@ -257,7 +257,7 @@
        When keypad is first enabled, ncurses loads the  key-defi-
        nitions for the current terminal description.  If the ter-
        minal description includes extended  string  capabilities,
-       e.g.,  from  using the -x option of tic, then ncurses also
+       e.g.,  from  using the -x option of tic, then ncurses also
        defines keys for the capabilities whose names  begin  with
        "k".   The  corresponding  keycodes are generated and (de-
        pending on previous loads of  terminal  descriptions)  may
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index cc7c6e6b..9725802c 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -235,7 +235,7 @@
        curses(3x) and related pages whose names begin "form_" for
        detailed descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index 24237fb4..4a621eeb 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: infocmp.1m,v 1.58 2016/10/01 17:15:45 tom Exp @
+  * @Id: infocmp.1m,v 1.59 2016/10/22 19:54:35 tom Exp @
 -->
 
 
@@ -121,7 +121,7 @@
 
        For best results when converting to  termcap  format,  you
        should use both -C and -r.  Normally a termcap description
-       is limited to 1023 bytes.  infocmp trims away less  essen-
+       is limited to 1023 bytes.  infocmp trims away less  essen-
        tial  parts  to make it fit.  If you are converting to one
        of the (rare)  termcap  implementations  which  accept  an
        unlimited  size  of  termcap,  you  may want to add the -T
@@ -216,7 +216,7 @@
        needed.
 
    Changing Databases [-A directory] [-B directory]
-       Like other ncurses utilities, infocmp looks for the termi-
+       Like other ncurses utilities, infocmp looks for the termi-
        nal descriptions in several places.  You can use the  TER-
        MINFO  and TERMINFO_DIRS environment variables to override
        the compiled-in default list  of  places  to  search  (see
@@ -478,7 +478,7 @@
 
        http://invisible-island.net/ncurses/tctest.html
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 

AUTHOR

diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index 18de61e4..5d06638b 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -88,7 +88,7 @@
 

SEE ALSO

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

AUTHOR

diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index f03f6cfe..adad98b0 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -217,7 +217,7 @@
        curses(3x) and related pages whose names begin "menu_" for
        detailed descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index 3d1cd67e..e38cd843 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -60,7 +60,7 @@
        sonable optimization.  This implementation is "new curses"
        (ncurses) and is the approved replacement for 4.4BSD clas-
        sic  curses,  which has been discontinued.  This describes
-       ncurses version 6.0 (patch 20161015).
+       ncurses version 6.0 (patch 20161022).
 
        The ncurses library emulates the curses library of  System
        V  Release  4  UNIX,  and  XPG4 (X/Open Portability Guide)
diff --git a/doc/html/man/ncurses5-config.1.html b/doc/html/man/ncurses6-config.1.html
similarity index 87%
rename from doc/html/man/ncurses5-config.1.html
rename to doc/html/man/ncurses6-config.1.html
index 19eb7985..769ef12c 100644
--- a/doc/html/man/ncurses5-config.1.html
+++ b/doc/html/man/ncurses6-config.1.html
@@ -33,36 +33,32 @@
 
 
 
-ncurses5-config 1
+ncurses6-config 1
 
 
 
 
-

ncurses5-config 1

+

ncurses6-config 1

-ncurses5-config(1)                                   ncurses5-config(1)
+ncurses6-config(1)                                   ncurses6-config(1)
 
 
 
 
-
-

NAME

-       ncurses5-config - helper script for ncurses libraries
+

NAME

+       ncurses6-config - helper script for ncurses libraries
 
 
-
-

SYNOPSIS

-       ncurses5-config [options]
+

SYNOPSIS

+       ncurses6-config [options]
 
 
-
-

DESCRIPTION

+

DESCRIPTION

        This is a shell script which simplifies configuring appli-
        cations against a particular set of ncurses libraries.
 
 
-
-

OPTIONS

+

OPTIONS

        --prefix
               echos the package-prefix of ncurses
 
@@ -115,15 +111,14 @@
        --help prints this message
 
 
-
-

SEE ALSO

+

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 5.9 (patch 20150523).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
-                                                     ncurses5-config(1)
+                                                     ncurses6-config(1)
 

SEE ALSO

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

AUTHOR

diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html
index 48493c17..18729d83 100644
--- a/doc/html/man/tabs.1.html
+++ b/doc/html/man/tabs.1.html
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tabs.1,v 1.13 2016/10/15 16:16:38 tom Exp @
+  * @Id: tabs.1,v 1.14 2016/10/22 19:54:35 tom Exp @
 -->
 
 
@@ -148,7 +148,7 @@
            terminal database provide this capability.
 
        o   There  is  no counterpart in X/Open Curses Issue 7 for
-           this utility, unlike tput(1).
+           this utility, unlike tput(1).
 
        The -d (debug) and -n (no-op) options are  extensions  not
        provided by other implementations.
@@ -164,7 +164,7 @@
 

SEE ALSO

        tset(1), infocmp(1m), curses(3x), terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html
index 309a23dc..bde9d971 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.23 2016/10/15 17:02:31 tom Exp @
+  * @Id: term.5,v 1.24 2016/10/22 19:55:01 tom Exp @
 -->
 
 
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 7c0b59bb..43269fe9 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -33,7 +33,7 @@
   ****************************************************************************
   * @Id: terminfo.head,v 1.22 2016/10/15 17:02:31 tom Exp @
   * Head of terminfo man page ends here
-  * @Id: terminfo.tail,v 1.72 2016/10/15 18:34:58 tom Exp @
+  * @Id: terminfo.tail,v 1.73 2016/10/22 19:56:17 tom Exp @
   * Beginning of terminfo.tail file
   * This file is part of ncurses.
   * See "terminfo.head" for copyright.
@@ -75,7 +75,7 @@
        nals by giving a set of capabilities which they  have,  by
        specifying how to perform screen operations, and by speci-
        fying padding requirements and  initialization  sequences.
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
        Entries in terminfo consist of a sequence of `,' separated
        fields (embedded commas may be escaped with a backslash or
@@ -1886,7 +1886,7 @@
        initially  set every n spaces when the terminal is powered
        up, the numeric parameter it is given, showing the  number
        of  spaces  the tabs are set to.  This is normally used by
-       the tset command to determine whether to set the mode  for
+       the tset command to determine whether to set the mode  for
        hardware  tab expansion, and whether to set the tab stops.
        If the terminal has tab stops that can be  saved  in  non-
        volatile  memory, the terminfo description can assume that
@@ -1899,7 +1899,7 @@
        These strings are expected to set the terminal into  modes
        consistent  with  the  rest  of  the terminfo description.
        They are normally sent to the terminal, by the init option
-       of  the  tput  program,  each time the user logs in.  They
+       of  the  tput  program,  each time the user logs in.  They
        will be printed in the following order:
 
               run the program
diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
index 90c1162c..6ee32a3c 100644
--- a/doc/html/man/tic.1m.html
+++ b/doc/html/man/tic.1m.html
@@ -401,7 +401,7 @@
        infocmp(1m),   captoinfo(1m),   infotocap(1m),    toe(1m),
        curses(3x), term(5).  terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 

AUTHOR

diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
index ab8af671..c7cfbd73 100644
--- a/doc/html/man/toe.1m.html
+++ b/doc/html/man/toe.1m.html
@@ -117,7 +117,7 @@
        tic(1m),   infocmp(1m),   captoinfo(1m),    infotocap(1m),
        curses(3x), terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
index 6483d3d0..000d45a9 100644
--- a/doc/html/man/tput.1.html
+++ b/doc/html/man/tput.1.html
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tput.1,v 1.44 2016/08/20 23:40:31 tom Exp @
+  * @Id: tput.1,v 1.46 2016/10/22 19:57:25 tom Exp @
 -->
 
 
@@ -170,43 +170,46 @@
 
 
 

Aliases

-       tput  handles  the  init  and reset commands specially: it
-       allows for the possibility that it is invoked  by  a  link
+       tput handles the clear, init and reset commands specially:
+       it allows for the possibility that it is invoked by a link
        with those names.
 
        If  tput  is  invoked  by a link named reset, this has the
        same effect as  tput  reset.   The  tset(1)  utility  also
-       treats a link named reset specially:
+       treats a link named reset specially.
 
-       o   That  utility  resets  the  terminal modes and special
-           characters (not done here).
+       Before  ncurses 6.1, the two utilities were different from
+       each other:
 
-       o   On the other hand, tset's repertoire of terminal capa-
-           bilities  for  resetting the terminal is more limited,
+       o   tset utility reset  the  terminal  modes  and  special
+           characters (not done with tput).
+
+       o   On the other hand, tset's repertoire of terminal capa-
+           bilities for resetting the terminal was more  limited,
            i.e., only reset_1string, reset_2string and reset_file
            in contrast to the tab-stops and margins which are set
            by this utility.
 
-       o   The reset program is usually an alias for tset, due to
-           the  resetting  of  terminal modes and special charac-
-           ters.
+       o   The  reset  program  is  usually  an  alias  for tset,
+           because of this  difference  with  resetting  terminal
+           modes and special characters.
 
        If tput is invoked by a link named init, this has the same
-       effect  as  tput  init.  Again, you are less likely to use
-       that link because another program named init  has  a  more
+       effect as tput init.  Again, you are less  likely  to  use
+       that  link  because  another program named init has a more
        well-established use.
 
 
 

EXAMPLES

        tput init
             Initialize the terminal according to the type of ter-
-            minal in the environmental variable TERM.  This  com-
-            mand  should be included in everyone's .profile after
+            minal  in the environmental variable TERM.  This com-
+            mand should be included in everyone's .profile  after
             the environmental variable TERM has been exported, as
             illustrated on the profile(5) manual page.
 
        tput -T5620 reset
-            Reset  an  AT&T 5620 terminal, overriding the type of
+            Reset an AT&T 5620 terminal, overriding the  type  of
             terminal in the environmental variable TERM.
 
        tput cup 0 0
@@ -227,16 +230,16 @@
        bold=`tput smso` offbold=`tput rmso`
             Set the shell variables bold, to begin stand-out mode
             sequence, and offbold, to end standout mode sequence,
-            for  the current terminal.  This might be followed by
-            a prompt: echo  "${bold}Please  type  in  your  name:
+            for the current terminal.  This might be followed  by
+            a  prompt:  echo  "${bold}Please  type  in your name:
             ${offbold}\c"
 
        tput hc
-            Set  exit code to indicate if the current terminal is
+            Set exit code to indicate if the current terminal  is
             a hard copy terminal.
 
        tput cup 23 4
-            Send the sequence to move the cursor to row 23,  col-
+            Send  the sequence to move the cursor to row 23, col-
             umn 4.
 
        tput cup
@@ -244,8 +247,8 @@
             parameters substituted.
 
        tput longname
-            Print the long name from the  terminfo  database  for
-            the  type  of terminal specified in the environmental
+            Print  the  long  name from the terminfo database for
+            the type of terminal specified in  the  environmental
             variable TERM.
 
             tput -S <<!
@@ -254,10 +257,10 @@
             > bold
             > !
 
-            This example shows tput processing several  capabili-
-            ties  in one invocation.  It clears the screen, moves
-            the cursor to position  10,  10  and  turns  on  bold
-            (extra  bright)  mode.   The list is terminated by an
+            This  example shows tput processing several capabili-
+            ties in one invocation.  It clears the screen,  moves
+            the  cursor  to  position  10,  10  and turns on bold
+            (extra bright) mode.  The list is  terminated  by  an
             exclamation mark (!) on a line by itself.
 
 
@@ -267,44 +270,44 @@
 
        /usr/share/tabset/*
               tab settings for some terminals, in a format appro-
-              priate   to  be  output  to  the  terminal  (escape
-              sequences that set  margins  and  tabs);  for  more
-              information,  see the Tabs and Initialization, sec-
+              priate  to  be  output  to  the  terminal   (escape
+              sequences  that  set  margins  and  tabs); for more
+              information, see the Tabs and Initialization,  sec-
               tion of terminfo(5)
 
 
 

EXIT CODES

        If the -S option is used, tput checks for errors from each
-       line,  and if any errors are found, will set the exit code
-       to 4 plus the number of lines with errors.  If  no  errors
-       are  found,  the  exit  code is 0.  No indication of which
+       line, and if any errors are found, will set the exit  code
+       to  4  plus the number of lines with errors.  If no errors
+       are found, the exit code is 0.   No  indication  of  which
        line failed can be given so exit code 1 will never appear.
-       Exit  codes 2, 3, and 4 retain their usual interpretation.
+       Exit codes 2, 3, and 4 retain their usual  interpretation.
        If the -S option is not used, the exit code depends on the
        type of capname:
 
           boolean
                  a value of 0 is set for TRUE and 1 for FALSE.
 
-          string a  value  of  0 is set if the capname is defined
-                 for this terminal type (the value of capname  is
-                 returned  on  standard  output); a value of 1 is
-                 set if capname is not defined for this  terminal
+          string a value of 0 is set if the  capname  is  defined
+                 for  this terminal type (the value of capname is
+                 returned on standard output); a value  of  1  is
+                 set  if capname is not defined for this terminal
                  type (nothing is written to standard output).
 
           integer
-                 a  value of 0 is always set, whether or not cap-
-                 name is defined  for  this  terminal  type.   To
-                 determine  if capname is defined for this termi-
-                 nal type, the user must test the  value  written
-                 to  standard  output.   A value of -1 means that
+                 a value of 0 is always set, whether or not  cap-
+                 name  is  defined  for  this  terminal type.  To
+                 determine if capname is defined for this  termi-
+                 nal  type,  the user must test the value written
+                 to standard output.  A value of  -1  means  that
                  capname is not defined for this terminal type.
 
-          other  reset or init may fail to find their  respective
-                 files.   In that case, the exit code is set to 4
+          other  reset  or init may fail to find their respective
+                 files.  In that case, the exit code is set to  4
                  + errno.
 
-       Any other exit code indicates an error; see  the  DIAGNOS-
+       Any  other  exit code indicates an error; see the DIAGNOS-
        TICS section.
 
 
@@ -314,8 +317,8 @@
 
        exit code   error message
        ---------------------------------------------------------------------
-       0           (capname is a numeric variable that is not specified  in
-                   the  terminfo(5)  database  for this terminal type, e.g.
+       0           (capname  is a numeric variable that is not specified in
+                   the terminfo(5) database for this  terminal  type,  e.g.
                    tput -T450 lines and tput -T2621 xmc)
        1           no error message is printed, see the EXIT CODES section.
        2           usage error
@@ -326,119 +329,119 @@
 
 
 

HISTORY

-       The tput command was begun by Bill Joy in 1980.  The  ini-
+       The  tput command was begun by Bill Joy in 1980.  The ini-
        tial version only cleared the screen.
 
-       AT&T  System  V  provided  a different tput command, whose
-       init and reset  subcommands (more than half  the  program)
+       AT&T System V provided a  different  tput  command,  whose
+       init  and  reset  subcommands (more than half the program)
        were incorporated from the reset feature of BSD tset writ-
-       ten by Eric Allman.  Later the corresponding  source  code
-       for  reset  was  removed  from the BSD tset (in June 1993,
+       ten  by  Eric Allman.  Later the corresponding source code
+       for reset was removed from the BSD  tset  (in  June  1993,
        released in 4.4BSD-Lite a year later).
 
-       Keith Bostic replaced the BSD tput command in 1989 with  a
-       new  implementation  based  on  the  AT&T System V program
-       tput.  Like the AT&T program,  Bostic's  version  accepted
-       some  parameters  named  for terminfo capabilities (clear,
-       init, longname and reset).  However (because he  had  only
-       termcap  available),  it  accepted termcap names for other
-       capabilities.  Also, Bostic's BSD tput did not modify  the
+       Keith  Bostic replaced the BSD tput command in 1989 with a
+       new implementation based on  the  AT&T  System  V  program
+       tput.   Like  the  AT&T program, Bostic's version accepted
+       some parameters named for  terminfo  capabilities  (clear,
+       init,  longname  and reset).  However (because he had only
+       termcap available), it accepted termcap  names  for  other
+       capabilities.   Also, Bostic's BSD tput did not modify the
        terminal I/O modes as the earlier BSD tset had done.
 
-       At  the  same  time,  Bostic  added  a  shell script named
+       At the same  time,  Bostic  added  a  shell  script  named
        "clear", which used tput to clear the screen.
 
-       Both of these appeared in 4.4BSD,  becoming  the  "modern"
+       Both  of  these  appeared in 4.4BSD, becoming the "modern"
        BSD implementation of tput.
 
 
 

PORTABILITY

-       This  implementation of tput differs from AT&T tput in two
+       This implementation of tput differs from AT&T tput in  two
        important areas:
 
-       o   tput capname writes to the standard output.  That need
-           not  be  a regular terminal.  However, the subcommands
-           which manipulate terminal modes may not use the  stan-
+       o   tput capname writes to the standard output.  That need
+           not be a regular terminal.  However,  the  subcommands
+           which  manipulate terminal modes may not use the stan-
            dard output.
 
-           The  AT&T implementation's init and reset commands use
+           The AT&T implementation's init and reset commands  use
            the BSD (4.1c) tset source, which manipulates terminal
-           modes.   It  successively tries standard output, stan-
-           dard error, standard  input  before  falling  back  to
+           modes.  It successively tries standard  output,  stan-
+           dard  error,  standard  input  before  falling back to
            "/dev/tty" and finally just assumes a 1200Bd terminal.
            When updating terminal modes, it ignores errors.
 
-           Until changes made after ncurses  6.0,  tput  did  not
-           modify  terminal  modes.   tput  now  uses  a  similar
-           scheme, using functions shared with  tset  (and  ulti-
-           mately  based  on the 4.4BSD tset).  If it is not able
-           to open a terminal, e.g., when running in  cron,  tput
+           Until  changes  made  after  ncurses 6.0, tput did not
+           modify  terminal  modes.   tput  now  uses  a  similar
+           scheme,  using  functions  shared with tset (and ulti-
+           mately based on the 4.4BSD tset).  If it is  not  able
+           to  open  a terminal, e.g., when running in cron, tput
            will return an error.
 
-       o   AT&T  tput guesses the type of its capname operands by
+       o   AT&T tput guesses the type of its capname operands  by
            seeing if all of the characters are numeric, or not.
 
            Most implementations which provide support for capname
-           operands  use  the tparm function to expand parameters
+           operands use the tparm function to  expand  parameters
            in it.  That function expects a mixture of numeric and
-           string  parameters,  requiring tput to know which type
+           string parameters, requiring tput to know  which  type
            to use.
 
-           This implementation uses  a  table  to  determine  the
+           This  implementation  uses  a  table  to determine the
            parameter types for the standard capname operands, and
-           an internal library function  to  analyze  nonstandard
+           an  internal  library  function to analyze nonstandard
            capname operands.
 
-       The  longname  and -S options, and the parameter-substitu-
-       tion features used in the cup example, were not  supported
-       in  BSD curses before 4.3reno (1989) or in AT&T/USL curses
+       The longname and -S options, and  the  parameter-substitu-
+       tion  features used in the cup example, were not supported
+       in BSD curses before 4.3reno (1989) or in AT&T/USL  curses
        before SVr4 (1988).
 
-       IEEE Std 1003.1/The Open Group  Base Specifications  Issue
-       7  (POSIX.1-2008)  documents  only the operands for clear,
-       init and reset.  There are a few interesting  observations
+       IEEE  Std 1003.1/The Open Group  Base Specifications Issue
+       7 (POSIX.1-2008) documents only the  operands  for  clear,
+       init  and reset.  There are a few interesting observations
        to make regarding that:
 
-       o   In  this  implementation, clear is part of the capname
+       o   In this implementation, clear is part of  the  capname
            support.  The others (init and longname) do not corre-
            spond to terminal capabilities.
 
-       o   Other  implementations  of  tput on SVr4-based systems
-           such as Solaris, IRIX64 and HPUX  as  well  as  others
-           such  as AIX and Tru64 provide support for capname op-
+       o   Other implementations of tput  on  SVr4-based  systems
+           such  as  Solaris,  IRIX64  and HPUX as well as others
+           such as AIX and Tru64 provide support for capname  op-
            erands.
 
-       o   A few platforms  such  as  FreeBSD  recognize  termcap
-           names  rather  than terminfo capability names in their
-           respective tput commands.  Since 2010,  NetBSD's  tput
-           uses  terminfo  names.  Before that, it (like FreeBSD)
+       o   A  few  platforms  such  as  FreeBSD recognize termcap
+           names rather than terminfo capability names  in  their
+           respective  tput  commands.  Since 2010, NetBSD's tput
+           uses terminfo names.  Before that, it  (like  FreeBSD)
            recognized termcap names.
 
-       Because (apparently) all of  the  certified  Unix  systems
-       support  the  full  set of capability names, the reasoning
+       Because  (apparently)  all  of  the certified Unix systems
+       support the full set of capability  names,  the  reasoning
        for documenting only a few may not be apparent.
 
        o   X/Open Curses Issue 7 documents tput differently, with
-           capname  and the other features used in this implemen-
+           capname and the other features used in this  implemen-
            tation.
 
-       o   That is, there are two standards for  tput:  POSIX  (a
-           subset)  and  X/Open Curses (the full implementation).
-           POSIX documents a subset to avoid the complication  of
-           including  X/Open Curses and the terminal capabilities
+       o   That  is,  there  are two standards for tput: POSIX (a
+           subset) and X/Open Curses (the  full  implementation).
+           POSIX  documents a subset to avoid the complication of
+           including X/Open Curses and the terminal  capabilities
            database.
 
        o   While it is certainly possible to write a tput program
            without using curses, none of the systems which have a
-           curses implementation provide  a  tput  utility  which
+           curses  implementation  provide  a  tput utility which
            does not provide the capname feature.
 
 
 

SEE ALSO

-       clear(1),    stty(1),   tabs(1),   tset(1),   terminfo(5),
+       clear(1),   stty(1),   tabs(1),   tset(1),    terminfo(5),
        curs_termcap(3x).
 
-       This describes ncurses version 6.0 (patch 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
index 4a6a048e..cd112fbb 100644
--- a/doc/html/man/tset.1.html
+++ b/doc/html/man/tset.1.html
@@ -387,7 +387,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 20161015).
+       This describes ncurses version 6.0 (patch 20161022).
 
 
 
diff --git a/man/curs_inopts.3x b/man/curs_inopts.3x
index baa88c88..31cf1989 100644
--- a/man/curs_inopts.3x
+++ b/man/curs_inopts.3x
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inopts.3x,v 1.22 2016/10/15 17:13:45 tom Exp $
+.\" $Id: curs_inopts.3x,v 1.23 2016/10/22 19:54:35 tom Exp $
 .TH curs_inopts 3X ""
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
@@ -296,7 +296,7 @@ just after initialization, even if your program remains in cooked mode.
 When \fBkeypad\fP is first enabled,
 ncurses loads the key-definitions for the current terminal description.
 If the terminal description includes extended string capabilities,
-e.g., from using the \fB\-x\fP option of @TIC@,
+e.g., from using the \fB\-x\fP option of \fB@TIC@\fP,
 then ncurses also defines keys for the capabilities whose names
 begin with "k".
 The corresponding keycodes are generated and (depending on previous
diff --git a/man/infocmp.1m b/man/infocmp.1m
index 49bd8701..ef47b7a2 100644
--- a/man/infocmp.1m
+++ b/man/infocmp.1m
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infocmp.1m,v 1.58 2016/10/01 17:15:45 tom Exp $
+.\" $Id: infocmp.1m,v 1.59 2016/10/22 19:54:35 tom Exp $
 .TH @INFOCMP@ 1M ""
 .ds n 5
 .de bP
@@ -138,7 +138,7 @@ These should be edited by hand.
 For best results when converting to \fBtermcap\fP format,
 you should use both \fB\-C\fP and \fB\-r\fP.
 Normally a termcap description is limited to 1023 bytes.
-@INFOCMP@ trims away less essential parts to make it fit.
+\fB@INFOCMP@\fP trims away less essential parts to make it fit.
 If you are converting to one of the (rare) termcap implementations
 which accept an unlimited size of termcap,
 you may want to add the \fB\-T\fP option.
@@ -235,7 +235,7 @@ superfluous.
 were not needed.
 .SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
 Like other \fBncurses\fP utilities,
-@INFOCMP@ looks for the terminal descriptions in several places.
+\fB@INFOCMP@\fP looks for the terminal descriptions in several places.
 You can use the \fBTERMINFO\fP and \fBTERMINFO_DIRS\fP environment variables
 to override the compiled-in default list of places to search
 (see \fBcurses\fP(3X) for details).
diff --git a/man/tabs.1 b/man/tabs.1
index 7928113f..938327d4 100644
--- a/man/tabs.1
+++ b/man/tabs.1
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tabs.1,v 1.13 2016/10/15 16:16:38 tom Exp $
+.\" $Id: tabs.1,v 1.14 2016/10/22 19:54:35 tom Exp $
 .TH @TABS@ 1 ""
 .ds n 5
 .de bP
@@ -133,7 +133,7 @@ This standard describes a \fB+m\fP option, to set a terminal's left-margin.
 Very few of the entries in the terminal database provide this capability.
 .bP
 There is no counterpart in X/Open Curses Issue 7 for this utility,
-unlike @TPUT@(1).
+unlike \fB@TPUT@(1)\fP.
 .PP
 The \fB\-d\fP (debug) and \fB\-n\fP (no-op) options are extensions not provided
 by other implementations.
diff --git a/man/term.5 b/man/term.5
index 8b50e959..311316f4 100644
--- a/man/term.5
+++ b/man/term.5
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.5,v 1.23 2016/10/15 17:02:31 tom Exp $
+.\" $Id: term.5,v 1.24 2016/10/22 19:55:01 tom Exp $
 .TH term 5
 .ds n 5
 .ds d @TERMINFO@
@@ -73,10 +73,8 @@ 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 ordering
 or sign extension are made.
 .PP
-The compiled file is created with the
-.B @TIC@
-program, and read by the routine
-.BR setupterm .
+The compiled file is created with the \fB@TIC@\fP program,
+and read by the routine \fBsetupterm\fP.
 The file is divided into six parts:
 the header,
 terminal names,
diff --git a/man/terminfo.tail b/man/terminfo.tail
index 280aead0..02fe0bd0 100644
--- a/man/terminfo.tail
+++ b/man/terminfo.tail
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.72 2016/10/15 18:34:58 tom Exp $
+.\" $Id: terminfo.tail,v 1.73 2016/10/22 19:56:17 tom Exp $
 .\" Beginning of terminfo.tail file
 .\" This file is part of ncurses.
 .\" See "terminfo.head" for copyright.
@@ -1082,8 +1082,7 @@ spaces when the terminal is powered up,
 the numeric parameter
 .B it
 is given, showing the number of spaces the tabs are set to.
-This is normally used by the
-.IR @TSET@
+This is normally used by the \fB@TSET@\fP
 command to determine whether to set the mode for hardware tab expansion,
 and whether to set the tab stops.
 If the terminal has tab stops that can be saved in non-volatile memory,
@@ -1103,9 +1102,7 @@ These strings are expected to set the terminal into modes consistent
 with the rest of the terminfo description.
 They are normally sent to the terminal, by the
 .I init
-option of the
-.IR @TPUT@
-program, each time the user logs in.
+option of the \fB@TPUT@\fP program, each time the user logs in.
 They will be printed in the following order:
 .RS
 .TP
diff --git a/man/tput.1 b/man/tput.1
index f8da1f23..6aafe816 100644
--- a/man/tput.1
+++ b/man/tput.1
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tput.1,v 1.44 2016/08/20 23:40:31 tom Exp $
+.\" $Id: tput.1,v 1.46 2016/10/22 19:57:25 tom Exp $
 .TH @TPUT@ 1 ""
 .ds d @TERMINFO@
 .ds n 1
@@ -168,21 +168,25 @@ of the terminal will be put out.  The long name is the last
 name in the first line of the terminal's description in the
 \fBterminfo\fR database [see \fBterm\fR(5)].
 .SS Aliases
-\fB@TPUT@\fR handles the \fBinit\fP and \fBreset\fP commands specially:
+\fB@TPUT@\fR handles the \fBclear\fP, \fBinit\fP and \fBreset\fP
+commands specially:
 it allows for the possibility that it is invoked by a link with those names.
 .PP
 If \fB@TPUT@\fR is invoked by a link named \fBreset\fR, this has the
 same effect as \fB@TPUT@ reset\fR.
-The \fB@TSET@\fR(\*n) utility also treats a link named \fBreset\fP specially:
+The \fB@TSET@\fR(\*n) utility also treats a link named \fBreset\fP specially.
+.PP
+Before ncurses 6.1, the two utilities were different from each other:
 .bP
-That utility resets the terminal modes and special characters (not done here).
+\fB@TSET@\fP utility reset the terminal modes and special characters
+(not done with \fB@TPUT@\fP).
 .bP
-On the other hand, @TSET@'s repertoire of terminal capabilities for
-resetting the terminal is more limited, i.e., only \fBreset_1string\fP, \fBreset_2string\fP and \fBreset_file\fP
+On the other hand, \fB@TSET@\fP's repertoire of terminal capabilities for
+resetting the terminal was more limited, i.e., only \fBreset_1string\fP, \fBreset_2string\fP and \fBreset_file\fP
 in contrast to the tab-stops and margins which are set by this utility.
 .bP
-The \fBreset\fP program is usually an alias for @TSET@,
-due to the resetting of terminal modes and special characters.
+The \fBreset\fP program is usually an alias for \fB@TSET@\fP,
+because of this difference with resetting terminal modes and special characters.
 .PP
 If \fB@TPUT@\fR is invoked by a link named \fBinit\fR, this has the
 same effect as \fB@TPUT@ init\fR.
@@ -356,7 +360,7 @@ becoming the \*(lqmodern\*(rq BSD implementation of \fBtput\fP.
 This implementation of \fBtput\fP differs from AT&T \fBtput\fP in
 two important areas:
 .bP
-@TPUT@ \fIcapname\fP writes to the standard output.
+\fB@TPUT@\fP \fIcapname\fP writes to the standard output.
 That need not be a regular terminal.
 However, the subcommands which manipulate terminal modes
 may not use the standard output.
@@ -368,11 +372,12 @@ before falling back to \*(lq/dev/tty\*(rq and finally just assumes
 a 1200Bd terminal.
 When updating terminal modes, it ignores errors.
 .IP
-Until changes made after ncurses 6.0, @TPUT@ did not modify terminal modes.
-@TPUT@ now uses a similar scheme, using functions shared with @TSET@
+Until changes made after ncurses 6.0, \fB@TPUT@\fP did not modify terminal modes.
+\fB@TPUT@\fP now uses a similar scheme,
+using functions shared with \fB@TSET@\fP
 (and ultimately based on the 4.4BSD \fBtset\fP).
 If it is not able to open a terminal, e.g., when running in \fBcron\fP,
-@TPUT@ will return an error.
+\fB@TPUT@\fP will return an error.
 .bP
 AT&T \fBtput\fP guesses the type of its \fIcapname\fP operands by seeing if
 all of the characters are numeric, or not.
diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog
index 87da00ad..5c81d34c 100644
--- a/package/debian-mingw/changelog
+++ b/package/debian-mingw/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161015) unstable; urgency=low
+ncurses6 (6.0+20161022) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 15 Oct 2016 11:43:49 -0400
+ -- Thomas E. Dickey   Fri, 21 Oct 2016 18:47:18 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog
index 87da00ad..5c81d34c 100644
--- a/package/debian-mingw64/changelog
+++ b/package/debian-mingw64/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161015) unstable; urgency=low
+ncurses6 (6.0+20161022) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 15 Oct 2016 11:43:49 -0400
+ -- Thomas E. Dickey   Fri, 21 Oct 2016 18:47:18 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian/changelog b/package/debian/changelog
index c6b1f9f1..80827c81 100644
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161015) unstable; urgency=low
+ncurses6 (6.0+20161022) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 15 Oct 2016 11:43:49 -0400
+ -- Thomas E. Dickey   Fri, 21 Oct 2016 18:47:18 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi
index 3f3aad2f..9db828ee 100644
--- a/package/mingw-ncurses.nsi
+++ b/package/mingw-ncurses.nsi
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.180 2016/10/15 15:43:49 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.181 2016/10/21 22:47:18 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  "2016"
-!define VERSION_MMDD  "1015"
+!define VERSION_MMDD  "1022"
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
 
 !define MY_ABI   "5"
diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec
index a8a11c91..bf5ad5ad 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: 20161015
+Release: 20161022
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncurses.spec b/package/ncurses.spec
index f863fc42..96d4bca2 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: 20161015
+Release: 20161022
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/progs/Makefile.in b/progs/Makefile.in
index 4b16e5a5..7de8c9e5 100644
--- a/progs/Makefile.in
+++ b/progs/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.97 2016/08/06 13:25:38 tom Exp $
+# $Id: Makefile.in,v 1.99 2016/10/22 00:13:20 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2015,2016 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -179,6 +179,7 @@ actual_tset      = `echo tset$x|      $(TRANSFORM)`
 
 # transformed names for comparing at runtime
 define_captoinfo = `echo captoinfo|   $(TRANSFORM)`
+define_clear     = `echo clear|       $(TRANSFORM)`
 define_infotocap = `echo infotocap|   $(TRANSFORM)`
 define_init      = `echo init|        $(TRANSFORM)`
 define_reset     = `echo reset|       $(TRANSFORM)`
@@ -191,6 +192,7 @@ transform.h :
 	-$(SHELL) -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi'
 	echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\""		>>$@
 	echo "#define PROG_INFOTOCAP \"$(define_infotocap)\""		>>$@
+	echo "#define PROG_CLEAR     \"$(define_clear)\""		>>$@
 	echo "#define PROG_RESET     \"$(define_reset)\""		>>$@
 	echo "#define PROG_INIT      \"$(define_init)\""		>>$@
 	echo "#endif /* __TRANSFORM_H */"				>>$@
@@ -248,7 +250,8 @@ toe$x: $(DEPS_TOE) $(DEPS_CURSES)
 	@ECHO_LD@ $(LINK) $(DEPS_TOE) $(LDFLAGS_TIC) -o $@
 
 DEPS_CLEAR = \
-	$(MODEL)/clear$o
+	$(MODEL)/clear$o \
+	$(MODEL)/clear_cmd$o
 
 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
 	@ECHO_LD@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
@@ -261,6 +264,7 @@ tabs$x: $(DEPS_TABS) $(DEPS_TABS)
 
 DEPS_TPUT = \
 	$(MODEL)/tput$o \
+	$(MODEL)/clear_cmd$o \
 	$(MODEL)/reset_cmd$o \
 	$(MODEL)/tparm_type$o \
 	$(MODEL)/transform$o
diff --git a/progs/clear.c b/progs/clear.c
index 4ac503ed..e9203a29 100644
--- a/progs/clear.c
+++ b/progs/clear.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2016 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            *
@@ -36,32 +36,19 @@
  * clear.c --  clears the terminal's screen
  */
 
-#define USE_LIBTINFO
-#include 
+#define USE_LIBTINFO 1
+#include 
 
-MODULE_ID("$Id: clear.c,v 1.13 2013/06/22 22:20:54 tom Exp $")
-
-static int
-putch(int c)
-{
-    return putchar(c);
-}
+MODULE_ID("$Id: clear.c,v 1.15 2016/10/23 00:36:36 tom Exp $")
 
 int
 main(
 	int argc GCC_UNUSED,
 	char *argv[]GCC_UNUSED)
 {
-    char *E3;
-
     setupterm((char *) 0, STDOUT_FILENO, (int *) 0);
 
-    /* Clear the scrollback buffer if possible. */
-    E3 = tigetstr("E3");
-    if (E3)
-	(void) tputs(E3, lines > 0 ? lines : 1, putch);
-
-    ExitProgram((tputs(clear_screen, lines > 0 ? lines : 1, putch) == ERR)
+    ExitProgram((clear_cmd() == ERR)
 		? EXIT_FAILURE
 		: EXIT_SUCCESS);
 }
diff --git a/progs/clear_cmd.c b/progs/clear_cmd.c
new file mode 100644
index 00000000..07d5636c
--- /dev/null
+++ b/progs/clear_cmd.c
@@ -0,0 +1,59 @@
+/****************************************************************************
+ * Copyright (c) 2016 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                                                *
+ ****************************************************************************/
+
+/*
+ * clear.c --  clears the terminal's screen
+ */
+
+#define USE_LIBTINFO
+#include 
+
+MODULE_ID("$Id: clear_cmd.c,v 1.1 2016/10/21 23:37:35 tom Exp $")
+
+static int
+putch(int c)
+{
+    return putchar(c);
+}
+
+int
+clear_cmd(void)
+{
+    char *E3;
+
+    /* Clear the scrollback buffer if possible. */
+    E3 = tigetstr("E3");
+    if (E3)
+	(void) tputs(E3, lines > 0 ? lines : 1, putch);
+
+    return tputs(clear_screen, lines > 0 ? lines : 1, putch);
+}
diff --git a/progs/clear_cmd.h b/progs/clear_cmd.h
new file mode 100644
index 00000000..28b7e7f7
--- /dev/null
+++ b/progs/clear_cmd.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ * Copyright (c) 2016 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                                                *
+ ****************************************************************************/
+
+/*
+ * $Id: clear_cmd.h,v 1.1 2016/10/21 23:29:04 tom Exp $
+ *
+ * Utility functions for clearing terminal.
+ */
+#ifndef CLEAR_CMD_H
+#define CLEAR_CMD_H 1
+
+#include 
+extern int clear_cmd(void);
+
+#endif /* CLEAR_CMD_H */
diff --git a/progs/modules b/progs/modules
index 6423b44d..f84d5df2 100644
--- a/progs/modules
+++ b/progs/modules
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.19 2016/08/06 16:52:30 tom Exp $
+# $Id: modules,v 1.20 2016/10/21 23:15:41 tom Exp $
 # Program modules (some are in ncurses lib!)
 ##############################################################################
 # Copyright (c) 1998-2014,2016 Free Software Foundation, Inc.                #
@@ -35,6 +35,7 @@
 clear		progs		$(srcdir)	$(HEADER_DEPS)
 tic		progs		$(srcdir)	$(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h
 toe		progs		$(srcdir)	$(HEADER_DEPS)             $(INCDIR)/hashed_db.h
+clear_cmd	progs		$(srcdir)	$(HEADER_DEPS) clear_cmd.h
 dump_entry	progs		$(srcdir)	$(HEADER_DEPS)             $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c
 infocmp		progs		$(srcdir)	$(HEADER_DEPS)             $(srcdir)/dump_entry.h
 reset_cmd	progs		$(srcdir)	$(HEADER_DEPS) reset_cmd.h
diff --git a/progs/reset_cmd.c b/progs/reset_cmd.c
index 09dba5e5..e0831e27 100644
--- a/progs/reset_cmd.c
+++ b/progs/reset_cmd.c
@@ -51,7 +51,7 @@
 #include 
 #endif
 
-MODULE_ID("$Id: reset_cmd.c,v 1.7 2016/09/10 20:49:10 tom Exp $")
+MODULE_ID("$Id: reset_cmd.c,v 1.9 2016/10/23 01:08:11 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -661,18 +661,26 @@ update_tty_settings(TTY * old_settings, TTY * new_settings)
 }
 
 #if HAVE_SIZECHANGE
-/* Set window size if not set already */
+/*
+ * Set window size if not set already, but update our copy of the values if the
+ * size was set.
+ */
 void
-set_window_size(int fd, int high, int wide)
+set_window_size(int fd, short *high, short *wide)
 {
     STRUCT_WINSIZE win;
     (void) ioctl(fd, IOCTL_GET_WINSIZE, &win);
     if (WINSIZE_ROWS(win) == 0 &&
-	WINSIZE_COLS(win) == 0 &&
-	high > 0 && wide > 0) {
-	WINSIZE_ROWS(win) = (unsigned short) high;
-	WINSIZE_COLS(win) = (unsigned short) wide;
-	(void) ioctl(fd, IOCTL_SET_WINSIZE, &win);
+	WINSIZE_COLS(win) == 0) {
+	if (*high > 0 && *wide > 0) {
+	    WINSIZE_ROWS(win) = (unsigned short) *high;
+	    WINSIZE_COLS(win) = (unsigned short) *wide;
+	    (void) ioctl(fd, IOCTL_SET_WINSIZE, &win);
+	}
+    } else if (WINSIZE_ROWS(win) > 0 &&
+	       WINSIZE_COLS(win) > 0) {
+	*high = (short) WINSIZE_ROWS(win);
+	*wide = (short) WINSIZE_COLS(win);
     }
 }
 #endif
diff --git a/progs/reset_cmd.h b/progs/reset_cmd.h
index 77f34a3b..19aee023 100644
--- a/progs/reset_cmd.h
+++ b/progs/reset_cmd.h
@@ -31,7 +31,7 @@
  ****************************************************************************/
 
 /*
- * $Id: reset_cmd.h,v 1.5 2016/08/06 20:09:34 tom Exp $
+ * $Id: reset_cmd.h,v 1.6 2016/10/22 23:34:37 tom Exp $
  *
  * Utility functions for resetting terminal.
  */
@@ -58,7 +58,7 @@ extern void set_conversions(TTY * /* tty_settings */);
 extern void update_tty_settings(TTY * /* old_settings */, TTY * /* new_settings */);
 
 #if HAVE_SIZECHANGE
-extern void set_window_size(int /* fd */, int /* high */, int /* wide */);
+extern void set_window_size(int /* fd */, short * /* high */, short * /* wide */);
 #endif
 
 extern const char *_nc_progname;
diff --git a/progs/tput.c b/progs/tput.c
index 8ff3be1b..b2d44f02 100644
--- a/progs/tput.c
+++ b/progs/tput.c
@@ -40,6 +40,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #if !PURE_TERMINFO
@@ -48,7 +49,7 @@
 #endif
 #include 
 
-MODULE_ID("$Id: tput.c,v 1.57 2016/08/20 21:46:31 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.63 2016/10/23 01:08:28 tom Exp $")
 
 #define PUTS(s)		fputs(s, stdout)
 
@@ -57,6 +58,7 @@ const char *_nc_progname = "tput";
 static char *prg_name;
 static bool is_init = FALSE;
 static bool is_reset = FALSE;
+static bool is_clear = FALSE;
 
 static void
 quit(int status, const char *fmt,...)
@@ -78,11 +80,21 @@ usage(void)
     ExitProgram(EXIT_FAILURE);
 }
 
-static void
-check_aliases(const char *name, bool program)
+static char *
+check_aliases(char *name, bool program)
 {
-    is_init = same_program(name, program ? PROG_INIT : "init");
-    is_reset = same_program(name, program ? PROG_RESET : "reset");
+    static char my_init[] = "init";
+    static char my_reset[] = "reset";
+    static char my_clear[] = "clear";
+
+    char *result = name;
+    if ((is_init = same_program(name, program ? PROG_INIT : my_init)))
+	result = my_init;
+    if ((is_reset = same_program(name, program ? PROG_RESET : my_reset)))
+	result = my_reset;
+    if ((is_clear = same_program(name, program ? PROG_CLEAR : my_clear)))
+	result = my_clear;
+    return result;
 }
 
 static int
@@ -114,9 +126,7 @@ tput_cmd(int argc, char *argv[])
     bool termcap = FALSE;
 #endif
 
-    if ((name = argv[0]) == 0)
-	name = "";
-    check_aliases(name, FALSE);
+    name = check_aliases(argv[0], FALSE);
     if (is_reset || is_init) {
 	TTY mode, oldmode;
 
@@ -124,11 +134,16 @@ tput_cmd(int argc, char *argv[])
 	int intrchar = -1;	/* new interrupt character */
 	int tkillchar = -1;	/* new kill character */
 
-	(void) save_tty_settings(&mode);
+	int my_fd = save_tty_settings(&mode);
 
 	reset_start(stdout, is_reset, is_init);
 	reset_tty_settings(&mode);
 
+#if HAVE_SIZECHANGE
+	set_window_size(my_fd, &lines, &columns);
+#else
+	(void) my_fd;
+#endif
 	set_control_chars(&mode, terasechar, intrchar, tkillchar);
 	set_conversions(&mode);
 	if (send_init_strings(&oldmode)) {
@@ -146,7 +161,9 @@ tput_cmd(int argc, char *argv[])
 #if !PURE_TERMINFO
   retry:
 #endif
-    if ((status = tigetflag(name)) != -1) {
+    if (strcmp(name, "clear") == 0) {
+	return clear_cmd();
+    } else if ((status = tigetflag(name)) != -1) {
 	return exit_code(BOOLEAN, status);
     } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) {
 	(void) printf("%d\n", status);
@@ -246,7 +263,7 @@ main(int argc, char **argv)
     char buf[BUFSIZ];
     int result = 0;
 
-    check_aliases(prg_name = _nc_rootname(argv[0]), TRUE);
+    prg_name = check_aliases(_nc_rootname(argv[0]), TRUE);
 
     term = getenv("TERM");
 
@@ -271,7 +288,7 @@ main(int argc, char **argv)
     /*
      * Modify the argument list to omit the options we processed.
      */
-    if (is_reset || is_init) {
+    if (is_clear || is_reset || is_init) {
 	if (optind-- < argc) {
 	    argc -= optind;
 	    argv += optind;
@@ -289,7 +306,7 @@ main(int argc, char **argv)
 	quit(3, "unknown terminal \"%s\"", term);
 
     if (cmdline) {
-	if ((argc <= 0) && !is_reset && !is_init)
+	if ((argc <= 0) && !(is_clear || is_reset || is_init))
 	    usage();
 	ExitProgram(tput_cmd(argc, argv));
     }
diff --git a/progs/tset.c b/progs/tset.c
index 8b96838e..f21cb6d7 100644
--- a/progs/tset.c
+++ b/progs/tset.c
@@ -96,7 +96,7 @@
 char *ttyname(int fd);
 #endif
 
-MODULE_ID("$Id: tset.c,v 1.112 2016/09/10 23:33:10 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.113 2016/10/22 23:34:47 tom Exp $")
 
 #ifndef environ
 extern char **environ;
@@ -844,7 +844,7 @@ main(int argc, char **argv)
     if (!noset) {
 #if HAVE_SIZECHANGE
 	if (opt_w) {
-	    set_window_size(my_fd, lines, columns);
+	    set_window_size(my_fd, &lines, &columns);
 	}
 #endif
 	if (opt_c) {
-- 
2.44.0