ncurses/ncurses-6.0-20161224.patch

1403 lines
57 KiB
Diff

# ncurses 6.0 - patch 20161224 - Thomas E. Dickey
#
# ------------------------------------------------------------------------------
#
# Ncurses 6.0 is at
# ftp.gnu.org:/pub/gnu
#
# Patches for ncurses 6.0 can be found at
# ftp://invisible-island.net/ncurses/6.0
# http://invisible-mirror.net/archives/ncurses/6.0
#
# ------------------------------------------------------------------------------
# ftp://invisible-island.net/ncurses/6.0/ncurses-6.0-20161224.patch.gz
# patch by Thomas E. Dickey <dickey@invisible-island.net>
# created Sun Dec 25 01:53:57 UTC 2016
# ------------------------------------------------------------------------------
# MANIFEST | 2
# NEWS | 11 ++
# VERSION | 2
# dist.mk | 4
# doc/html/man/adacurses6-config.1.html | 2
# doc/html/man/captoinfo.1m.html | 2
# doc/html/man/clear.1.html | 2
# doc/html/man/form.3x.html | 2
# doc/html/man/infocmp.1m.html | 2
# doc/html/man/infotocap.1m.html | 2
# doc/html/man/menu.3x.html | 2
# doc/html/man/ncurses.3x.html | 2
# doc/html/man/ncurses6-config.1.html | 2
# doc/html/man/panel.3x.html | 2
# doc/html/man/tabs.1.html | 2
# doc/html/man/terminfo.5.html | 118 ++++++++++++++++------------
# doc/html/man/tic.1m.html | 2
# doc/html/man/toe.1m.html | 2
# doc/html/man/tput.1.html | 2
# doc/html/man/tset.1.html | 2
# form/frm_driver.c | 5 -
# man/terminfo.tail | 40 ++++++---
# ncurses-6.0-20161224/progs/tty_settings.c | 109 +++++++++++++++++++++++++
# ncurses-6.0-20161224/progs/tty_settings.h | 50 +++++++++++
# ncurses/tinfo/lib_ttyflags.c | 36 ++++----
# ncurses/tinfo/tinfo_driver.c | 40 +++++++++
# 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 | 11 +-
# progs/clear.c | 16 +++
# progs/modules | 11 +-
# progs/reset_cmd.c | 65 +--------------
# progs/reset_cmd.h | 9 --
# progs/tput.c | 33 ++++---
# progs/tset.c | 9 +-
# 39 files changed, 415 insertions(+), 206 deletions(-)
# ------------------------------------------------------------------------------
Index: MANIFEST
--- ncurses-6.0-20161217+/MANIFEST 2016-12-17 23:39:59.000000000 +0000
+++ ncurses-6.0-20161224/MANIFEST 2016-12-25 00:18:45.000000000 +0000
@@ -1064,6 +1064,8 @@
./progs/tput.c
./progs/transform.c
./progs/tset.c
+./progs/tty_settings.c
+./progs/tty_settings.h
./test/Makefile.in
./test/README
./test/aclocal.m4
Index: NEWS
Prereq: 1.2711
--- ncurses-6.0-20161217+/NEWS 2016-12-17 23:41:02.000000000 +0000
+++ ncurses-6.0-20161224/NEWS 2016-12-24 23:45:38.000000000 +0000
@@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2711 2016/12/17 23:41:02 tom Exp $
+-- $Id: NEWS,v 1.2715 2016/12/24 23:45:38 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,15 @@
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20161224
+ + correct parmeters for copywin call in _nc_Synchronize_Attributes()
+ (patch by Leon Winter).
+ + improve color-handling section in terminfo manual page (prompted by
+ patch by Mihail Konev).
+ + modify programs clear, tput and tset to pass the actual tty file
+ descriptor to setupterm rather than the standard output, making
+ padding work.
+
20161217
+ add tput-colorcube demo script.
+ add -r and -s options to tput-initc demo, to match usage in xterm.
Index: VERSION
--- ncurses-6.0-20161217+/VERSION 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/VERSION 2016-12-24 13:45:15.000000000 +0000
@@ -1 +1 @@
-5:0:9 6.0 20161217
+5:0:9 6.0 20161224
Index: dist.mk
Prereq: 1.1137
--- ncurses-6.0-20161217+/dist.mk 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/dist.mk 2016-12-24 13:45:15.000000000 +0000
@@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1137 2016/12/17 16:05:02 tom Exp $
+# $Id: dist.mk,v 1.1138 2016/12/24 13:45:15 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 0
-NCURSES_PATCH = 20161217
+NCURSES_PATCH = 20161224
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
Index: doc/html/man/adacurses6-config.1.html
--- ncurses-6.0-20161217+/doc/html/man/adacurses6-config.1.html 2016-12-04 01:10:35.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/adacurses6-config.1.html 2016-12-25 00:16:10.000000000 +0000
@@ -131,7 +131,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/captoinfo.1m.html
--- ncurses-6.0-20161217+/doc/html/man/captoinfo.1m.html 2016-12-04 01:10:35.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/captoinfo.1m.html 2016-12-25 00:16:10.000000000 +0000
@@ -198,7 +198,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
Index: doc/html/man/clear.1.html
--- ncurses-6.0-20161217+/doc/html/man/clear.1.html 2016-12-04 01:10:35.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/clear.1.html 2016-12-25 00:16:10.000000000 +0000
@@ -135,7 +135,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/form.3x.html
--- ncurses-6.0-20161217+/doc/html/man/form.3x.html 2016-12-04 01:10:37.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/form.3x.html 2016-12-25 00:16:12.000000000 +0000
@@ -239,7 +239,7 @@
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for
detailed descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/infocmp.1m.html
--- ncurses-6.0-20161217+/doc/html/man/infocmp.1m.html 2016-12-04 01:10:38.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/infocmp.1m.html 2016-12-25 00:16:13.000000000 +0000
@@ -478,7 +478,7 @@
http://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
Index: doc/html/man/infotocap.1m.html
--- ncurses-6.0-20161217+/doc/html/man/infotocap.1m.html 2016-12-04 01:10:38.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/infotocap.1m.html 2016-12-25 00:16:13.000000000 +0000
@@ -88,7 +88,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
Index: doc/html/man/menu.3x.html
--- ncurses-6.0-20161217+/doc/html/man/menu.3x.html 2016-12-04 01:10:38.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/menu.3x.html 2016-12-25 00:16:13.000000000 +0000
@@ -217,7 +217,7 @@
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for
detailed descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/ncurses.3x.html
--- ncurses-6.0-20161217+/doc/html/man/ncurses.3x.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/ncurses.3x.html 2016-12-25 00:16:14.000000000 +0000
@@ -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
- <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
The <STRONG>ncurses</STRONG> library emulates the curses library of System
V Release 4 UNIX, and XPG4 (X/Open Portability Guide)
Index: doc/html/man/ncurses6-config.1.html
--- ncurses-6.0-20161217+/doc/html/man/ncurses6-config.1.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/ncurses6-config.1.html 2016-12-25 00:16:14.000000000 +0000
@@ -114,7 +114,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/panel.3x.html
--- ncurses-6.0-20161217+/doc/html/man/panel.3x.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/panel.3x.html 2016-12-25 00:16:14.000000000 +0000
@@ -208,7 +208,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
Index: doc/html/man/tabs.1.html
--- ncurses-6.0-20161217+/doc/html/man/tabs.1.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/tabs.1.html 2016-12-25 00:16:14.000000000 +0000
@@ -164,7 +164,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/terminfo.5.html
--- ncurses-6.0-20161217+/doc/html/man/terminfo.5.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/terminfo.5.html 2016-12-25 00:16:15.000000000 +0000
@@ -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.74 2016/11/05 21:15:43 Alain.Williams Exp @
+ * @Id: terminfo.tail,v 1.75 2016/12/24 22:54:11 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 <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Entries in <EM>terminfo</EM> consist of a sequence of `,' separated
fields (embedded commas may be escaped with a backslash or
@@ -2067,41 +2067,57 @@
</PRE><H3><a name="h3-Color-Handling">Color Handling</a></H3><PRE>
- Most color terminals are either "Tektronix-like" or "HP-
- like". Tektronix-like terminals have a predefined set of
- N colors (where N usually 8), and can set character-cell
- foreground and background characters independently, mixing
- them into N * N color-pairs. On HP-like terminals, the
- use must set each color pair up separately (foreground and
- background are not independently settable). Up to M
- color-pairs may be set up from 2*M different colors.
- ANSI-compatible terminals are Tektronix-like.
+ The curses library functions <STRONG>init_pair</STRONG> and <STRONG>init_color</STRONG>
+ manipulate the <EM>color</EM> <EM>pairs</EM> and <EM>color</EM> <EM>values</EM> discussed in
+ this section (see <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> for details on these and
+ related functions).
+
+ Most color terminals are either "Tektronix-like" or "HP-
+ like":
+
+ <STRONG>o</STRONG> Tektronix-like terminals have a predefined set of <EM>N</EM>
+ colors (where <EM>N</EM> is usually 8), and can set character-
+ cell foreground and background characters indepen-
+ dently, mixing them into <EM>N</EM> * <EM>N</EM> color-pairs.
+
+ <STRONG>o</STRONG> On HP-like terminals, the user must set each color
+ pair up separately (foreground and background are not
+ independently settable). Up to <EM>M</EM> color-pairs may be
+ set up from 2*<EM>M</EM> different colors. ANSI-compatible
+ terminals are Tektronix-like.
Some basic color capabilities are independent of the color
method. The numeric capabilities <STRONG>colors</STRONG> and <STRONG>pairs</STRONG> specify
- the maximum numbers of colors and color-pairs that can be
- displayed simultaneously. The <STRONG>op</STRONG> (original pair) string
- resets foreground and background colors to their default
- values for the terminal. The <STRONG>oc</STRONG> string resets all colors
- or color-pairs to their default values for the terminal.
- Some terminals (including many PC terminal emulators)
- erase screen areas with the current background color
- rather than the power-up default background; these should
+ the maximum numbers of colors and color-pairs that can be
+ displayed simultaneously. The <STRONG>op</STRONG> (original pair) string
+ resets foreground and background colors to their default
+ values for the terminal. The <STRONG>oc</STRONG> string resets all colors
+ or color-pairs to their default values for the terminal.
+ Some terminals (including many PC terminal emulators)
+ erase screen areas with the current background color
+ rather than the power-up default background; these should
have the boolean capability <STRONG>bce</STRONG>.
- To change the current foreground or background color on a
- Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI foreground)
- and <STRONG>setab</STRONG> (set ANSI background) or <STRONG>setf</STRONG> (set foreground)
- and <STRONG>setb</STRONG> (set background). These take one parameter, the
- color number. The SVr4 documentation describes only
- <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft says that "If the terminal
- supports ANSI escape sequences to set background and fore-
- ground, they should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, respec-
- tively. If the terminal supports other escape sequences
- to set background and foreground, they should be coded as
- <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, respectively. The <STRONG>vidputs</STRONG> function and the
- refresh functions use <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> if they are
- defined."
+ While the curses library works with <EM>color</EM> <EM>pairs</EM> (reflect-
+ ing the inability of some devices to set foreground and
+ background colors independently), there are separate capa-
+ bilities for setting these features:
+
+ <STRONG>o</STRONG> To change the current foreground or background color
+ on a Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI
+ foreground) and <STRONG>setab</STRONG> (set ANSI background) or <STRONG>setf</STRONG>
+ (set foreground) and <STRONG>setb</STRONG> (set background). These
+ take one parameter, the color number. The SVr4 docu-
+ mentation describes only <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft
+ says that "If the terminal supports ANSI escape
+ sequences to set background and foreground, they
+ should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, respectively.
+
+ <STRONG>o</STRONG> If the terminal supports other escape sequences to set
+ background and foreground, they should be coded as
+ <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, respectively. The <STRONG>vidputs</STRONG> and the
+ <STRONG>refresh</STRONG> functions use the <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> capabilities
+ if they are defined.
The <STRONG>setaf</STRONG>/<STRONG>setab</STRONG> and <STRONG>setf</STRONG>/<STRONG>setb</STRONG> capabilities take a single
numeric argument each. Argument values 0-7 of <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>
@@ -2141,21 +2157,25 @@
On an HP-like terminal, use <STRONG>scp</STRONG> with a color-pair number
parameter to set which color pair is current.
- On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may be
- present to indicate that colors can be modified. If so,
- the <STRONG>initc</STRONG> capability will take a color number (0 to <STRONG>colors</STRONG>
- - 1)and three more parameters which describe the color.
- These three parameters default to being interpreted as RGB
- (Red, Green, Blue) values. If the boolean capability <STRONG>hls</STRONG>
- is present, they are instead as HLS (Hue, Lightness, Satu-
- ration) indices. The ranges are terminal-dependent.
-
- On an HP-like terminal, <STRONG>initp</STRONG> may give a capability for
- changing a color-pair value. It will take seven parame-
- ters; a color-pair number (0 to <STRONG>max_pairs</STRONG> - 1), and two
- triples describing first background and then foreground
- colors. These parameters must be (Red, Green, Blue) or
- (Hue, Lightness, Saturation) depending on <STRONG>hls</STRONG>.
+ Some terminals allow the <EM>color</EM> <EM>values</EM> to be modified:
+
+ <STRONG>o</STRONG> On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may
+ be present to indicate that colors can be modified.
+ If so, the <STRONG>initc</STRONG> capability will take a color number
+ (0 to <STRONG>colors</STRONG> - 1)and three more parameters which
+ describe the color. These three parameters default to
+ being interpreted as RGB (Red, Green, Blue) values.
+ If the boolean capability <STRONG>hls</STRONG> is present, they are
+ instead as HLS (Hue, Lightness, Saturation) indices.
+ The ranges are terminal-dependent.
+
+ <STRONG>o</STRONG> On an HP-like terminal, <STRONG>initp</STRONG> may give a capability
+ for changing a color-pair value. It will take seven
+ parameters; a color-pair number (0 to <STRONG>max_pairs</STRONG> - 1),
+ and two triples describing first background and then
+ foreground colors. These parameters must be (Red,
+ Green, Blue) or (Hue, Lightness, Saturation) depending
+ on <STRONG>hls</STRONG>.
On some color terminals, colors collide with highlights.
You can register these collisions with the <STRONG>ncv</STRONG> capability.
@@ -2493,8 +2513,8 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.
- <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
+ <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,
+ <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
Index: doc/html/man/tic.1m.html
--- ncurses-6.0-20161217+/doc/html/man/tic.1m.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/tic.1m.html 2016-12-25 00:16:15.000000000 +0000
@@ -401,7 +401,7 @@
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
Index: doc/html/man/toe.1m.html
--- ncurses-6.0-20161217+/doc/html/man/toe.1m.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/toe.1m.html 2016-12-25 00:16:15.000000000 +0000
@@ -117,7 +117,7 @@
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/tput.1.html
--- ncurses-6.0-20161217+/doc/html/man/tput.1.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/tput.1.html 2016-12-25 00:16:15.000000000 +0000
@@ -441,7 +441,7 @@
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: doc/html/man/tset.1.html
--- ncurses-6.0-20161217+/doc/html/man/tset.1.html 2016-12-04 01:10:39.000000000 +0000
+++ ncurses-6.0-20161224/doc/html/man/tset.1.html 2016-12-25 00:16:15.000000000 +0000
@@ -387,7 +387,7 @@
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>,
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Index: form/frm_driver.c
Prereq: 1.119
--- ncurses-6.0-20161217+/form/frm_driver.c 2016-10-29 22:30:10.000000000 +0000
+++ ncurses-6.0-20161224/form/frm_driver.c 2016-12-24 22:28:28.000000000 +0000
@@ -32,7 +32,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.119 2016/10/29 22:30:10 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.120 2016/12/24 22:28:28 Leon.Winter Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@@ -1275,7 +1275,8 @@
copywin(form->w, formwin,
0, 0,
field->frow, field->fcol,
- field->rows - 1, field->cols - 1, 0);
+ field->frow + field->rows - 1,
+ field->fcol + field->cols - 1, 0);
wsyncup(formwin);
Buffer_To_Window(field, form->w);
SetStatus(field, _NEWTOP); /* fake refresh to paint all */
Index: man/terminfo.tail
Prereq: 1.74
--- ncurses-6.0-20161217+/man/terminfo.tail 2016-11-05 21:15:43.000000000 +0000
+++ ncurses-6.0-20161224/man/terminfo.tail 2016-12-24 22:54:11.000000000 +0000
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.74 2016/11/05 21:15:43 Alain.Williams Exp $
+.\" $Id: terminfo.tail,v 1.75 2016/12/24 22:54:11 tom Exp $
.\" Beginning of terminfo.tail file
.\" This file is part of ncurses.
.\" See "terminfo.head" for copyright.
@@ -1324,16 +1324,24 @@
.PP
.SS Color Handling
.PP
-Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*(''.
+The curses library functions \fBinit_pair\fP and \fBinit_color\fP
+manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
+section
+(see \fBcurs_color\fP(3X) for details on these and related functions).
+.PP
+Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
+.bP
Tektronix-like
-terminals have a predefined set of N colors (where N usually 8), and can set
+terminals have a predefined set of \fIN\fP colors
+(where \fIN\fP is usually 8),
+and can set
character-cell foreground and background characters independently, mixing them
-into N\ *\ N color-pairs.
-On HP-like terminals, the use must set each color
+into \fIN\fP\ *\ \fIN\fP color-pairs.
+.bP
+On HP-like terminals, the user must set each color
pair up separately (foreground and background are not independently settable).
-Up to M color-pairs may be set up from 2*M different colors.
-ANSI-compatible
-terminals are Tektronix-like.
+Up to \fIM\fP color-pairs may be set up from 2*\fIM\fP different colors.
+ANSI-compatible terminals are Tektronix-like.
.PP
Some basic color capabilities are independent of the color method.
The numeric
@@ -1349,6 +1357,11 @@
than the power-up default background; these should have the boolean capability
\fBbce\fR.
.PP
+While the curses library works with \fIcolor pairs\fP
+(reflecting the inability of some devices to set foreground
+and background colors independently),
+there are separate capabilities for setting these features:
+.bP
To change the current foreground or background color on a Tektronix-type
terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
@@ -1357,12 +1370,12 @@
only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
supports ANSI escape sequences to set background and foreground, they should
be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
+.bP
If the terminal
supports other escape sequences to set background and foreground, they should
be coded as \fBsetf\fR and \fBsetb\fR, respectively.
-The \fBvidputs\fR
-function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are
-defined."
+The \fBvidputs\fR and the \fBrefresh\fP functions
+use the \fBsetaf\fR and \fBsetab\fR capabilities if they are defined.
.PP
The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
single numeric argument each.
@@ -1411,6 +1424,8 @@
On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
which color pair is current.
.PP
+Some terminals allow the \fIcolor values\fP to be modified:
+.bP
On a Tektronix-like terminal, the capability \fBccc\fR may be present to
indicate that colors can be modified.
If so, the \fBinitc\fR capability will
@@ -1422,7 +1437,7 @@
they are instead as HLS (Hue, Lightness, Saturation) indices.
The ranges are
terminal-dependent.
-.PP
+.bP
On an HP-like terminal, \fBinitp\fR may give a capability for changing a
color-pair value.
It will take seven parameters; a color-pair number (0 to
@@ -1811,6 +1826,7 @@
\fB@TIC@\fR(1M),
\fB@INFOCMP@\fR(1M),
\fBcurses\fR(3X),
+\fBcurs_color\fR(3X),
\fBprintf\fR(3),
\fBterm\fR(\*n).
\fBterm_variables\fR(3X).
Index: ncurses/tinfo/lib_ttyflags.c
Prereq: 1.30
--- ncurses-6.0-20161217+/ncurses/tinfo/lib_ttyflags.c 2014-04-26 18:47:20.000000000 +0000
+++ ncurses-6.0-20161224/ncurses/tinfo/lib_ttyflags.c 2016-12-24 21:41:24.000000000 +0000
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,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 *
@@ -41,42 +41,42 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_ttyflags.c,v 1.30 2014/04/26 18:47:20 juergen Exp $")
+MODULE_ID("$Id: lib_ttyflags.c,v 1.31 2016/12/24 21:41:24 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf)
{
+ TERMINAL *termp = TerminalOf(SP_PARM);
int result = OK;
- if (buf == 0 || SP_PARM == 0) {
+ if (buf == 0 || termp == 0) {
result = ERR;
} else {
- TERMINAL *termp = TerminalOf(SP_PARM);
- if (0 == termp) {
- result = ERR;
- } else {
#ifdef USE_TERM_DRIVER
+ if (SP_PARM != 0) {
result = CallDriver_2(SP_PARM, td_sgmode, FALSE, buf);
+ } else {
+ result = ERR;
+ }
#else
- for (;;) {
- if (GET_TTY(termp->Filedes, buf) != 0) {
- if (errno == EINTR)
- continue;
- result = ERR;
- }
- break;
+ for (;;) {
+ if (GET_TTY(termp->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ result = ERR;
}
-#endif
+ break;
}
-
- if (result == ERR)
- memset(buf, 0, sizeof(*buf));
+#endif
TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
termp ? termp->Filedes : -1,
_nc_trace_ttymode(buf)));
}
+ if (result == ERR && buf != 0)
+ memset(buf, 0, sizeof(*buf));
+
return (result);
}
Index: ncurses/tinfo/tinfo_driver.c
Prereq: 1.41
--- ncurses-6.0-20161217+/ncurses/tinfo/tinfo_driver.c 2016-09-10 20:14:56.000000000 +0000
+++ ncurses-6.0-20161224/ncurses/tinfo/tinfo_driver.c 2016-12-24 23:20:08.000000000 +0000
@@ -34,6 +34,7 @@
#include <curses.priv.h>
#define CUR ((TERMINAL*)TCB)->type.
#include <tic.h>
+#include <termcap.h> /* ospeed */
#if HAVE_NANOSLEEP
#include <time.h>
@@ -50,7 +51,7 @@
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.41 2016/09/10 20:14:56 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.43 2016/12/24 23:20:08 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
@@ -113,6 +114,33 @@
return "tinfo";
}
+static void
+get_baudrate(TERMINAL * termp)
+{
+ int my_ospeed;
+ int result;
+ if (GET_TTY(termp->Filedes, &termp->Nttyb) == OK) {
+#ifdef TERMIOS
+ termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS);
+#else
+ termp->Nttyb.sg_flags &= (unsigned) (~XTABS);
+#endif
+ }
+#ifdef USE_OLD_TTY
+ result = (int) cfgetospeed(&(termp->Nttyb));
+ my_ospeed = (NCURSES_OSPEED) _nc_ospeed(result);
+#else /* !USE_OLD_TTY */
+#ifdef TERMIOS
+ my_ospeed = (NCURSES_OSPEED) cfgetospeed(&(termp->Nttyb));
+#else
+ my_ospeed = (NCURSES_OSPEED) termp->Nttyb.sg_ospeed;
+#endif
+ result = _nc_baudrate(my_ospeed);
+#endif
+ termp->_baudrate = result;
+ ospeed = (NCURSES_OSPEED) my_ospeed;
+}
+
#undef SETUP_FAIL
#define SETUP_FAIL FALSE
@@ -166,6 +194,16 @@
if (command_character)
_nc_tinfo_cmdch(termp, *command_character);
+ /*
+ * If an application calls setupterm() rather than initscr() or
+ * newterm(), we will not have the def_prog_mode() call in
+ * _nc_setupscreen(). Do it now anyway, so we can initialize the
+ * baudrate.
+ */
+ if (sp == 0 && NC_ISATTY(termp->Filedes)) {
+ get_baudrate(termp);
+ }
+
if (generic_type) {
/*
* BSD 4.3's termcap contains mis-typed "gn" for wy99. Do a sanity
Index: package/debian-mingw/changelog
--- ncurses-6.0-20161217+/package/debian-mingw/changelog 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/debian-mingw/changelog 2016-12-24 13:45:15.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
Index: package/debian-mingw64/changelog
--- ncurses-6.0-20161217+/package/debian-mingw64/changelog 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/debian-mingw64/changelog 2016-12-24 13:45:15.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
Index: package/debian/changelog
--- ncurses-6.0-20161217+/package/debian/changelog 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/debian/changelog 2016-12-24 13:45:15.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
Index: package/mingw-ncurses.nsi
Prereq: 1.189
--- ncurses-6.0-20161217+/package/mingw-ncurses.nsi 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/mingw-ncurses.nsi 2016-12-24 13:45:15.000000000 +0000
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.189 2016/12/17 16:05:02 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.190 2016/12/24 13:45:15 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 "1217"
+!define VERSION_MMDD "1224"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"
Index: package/mingw-ncurses.spec
--- ncurses-6.0-20161217+/package/mingw-ncurses.spec 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/mingw-ncurses.spec 2016-12-24 13:45:15.000000000 +0000
@@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.0
-Release: 20161217
+Release: 20161224
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Index: package/ncurses.spec
--- ncurses-6.0-20161217+/package/ncurses.spec 2016-12-17 16:05:02.000000000 +0000
+++ ncurses-6.0-20161224/package/ncurses.spec 2016-12-24 13:45:15.000000000 +0000
@@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.0
-Release: 20161217
+Release: 20161224
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Index: progs/Makefile.in
Prereq: 1.99
--- ncurses-6.0-20161217+/progs/Makefile.in 2016-10-22 00:13:20.000000000 +0000
+++ ncurses-6.0-20161224/progs/Makefile.in 2016-12-24 17:35:01.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.99 2016/10/22 00:13:20 tom Exp $
+# $Id: Makefile.in,v 1.100 2016/12/24 17:35:01 tom Exp $
##############################################################################
# Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. #
# #
@@ -251,7 +251,8 @@
DEPS_CLEAR = \
$(MODEL)/clear$o \
- $(MODEL)/clear_cmd$o
+ $(MODEL)/clear_cmd$o \
+ $(MODEL)/tty_settings$o
clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
@ECHO_LD@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
@@ -267,7 +268,8 @@
$(MODEL)/clear_cmd$o \
$(MODEL)/reset_cmd$o \
$(MODEL)/tparm_type$o \
- $(MODEL)/transform$o
+ $(MODEL)/transform$o \
+ $(MODEL)/tty_settings$o
tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
@ECHO_LD@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
@@ -282,7 +284,8 @@
DEPS_TSET = \
$(MODEL)/tset$o \
$(MODEL)/reset_cmd$o \
- $(MODEL)/transform$o
+ $(MODEL)/transform$o \
+ $(MODEL)/tty_settings$o
tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
@ECHO_LD@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
Index: progs/clear.c
Prereq: 1.15
--- ncurses-6.0-20161217+/progs/clear.c 2016-10-23 00:36:36.000000000 +0000
+++ ncurses-6.0-20161224/progs/clear.c 2016-12-24 19:33:39.000000000 +0000
@@ -36,17 +36,27 @@
* clear.c -- clears the terminal's screen
*/
-#define USE_LIBTINFO 1
+#define USE_LIBTINFO
#include <clear_cmd.h>
+#include <tty_settings.h>
-MODULE_ID("$Id: clear.c,v 1.15 2016/10/23 00:36:36 tom Exp $")
+MODULE_ID("$Id: clear.c,v 1.17 2016/12/24 19:33:39 tom Exp $")
+
+const char *_nc_progname = "clear";
int
main(
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
- setupterm((char *) 0, STDOUT_FILENO, (int *) 0);
+ TTY tty_settings;
+ int fd;
+
+ _nc_progname = _nc_rootname(argv[0]);
+
+ fd = save_tty_settings(&tty_settings);
+
+ setupterm((char *) 0, fd, (int *) 0);
ExitProgram((clear_cmd() == ERR)
? EXIT_FAILURE
Index: progs/modules
Prereq: 1.20
--- ncurses-6.0-20161217+/progs/modules 2016-10-21 23:15:41.000000000 +0000
+++ ncurses-6.0-20161224/progs/modules 2016-12-24 17:33:59.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.20 2016/10/21 23:15:41 tom Exp $
+# $Id: modules,v 1.21 2016/12/24 17:33:59 tom Exp $
# Program modules (some are in ncurses lib!)
##############################################################################
# Copyright (c) 1998-2014,2016 Free Software Foundation, Inc. #
@@ -32,17 +32,18 @@
#
@ base
-clear progs $(srcdir) $(HEADER_DEPS)
+clear progs $(srcdir) $(HEADER_DEPS) tty_settings.h
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
+reset_cmd progs $(srcdir) $(HEADER_DEPS) reset_cmd.h tty_settings.h
tabs progs $(srcdir) $(HEADER_DEPS)
tparm_type progs $(srcdir) $(HEADER_DEPS) $(srcdir)/tparm_type.h
-tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h termsort.c reset_cmd.h
-tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h reset_cmd.h
+tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h termsort.c reset_cmd.h tty_settings.h
+tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h reset_cmd.h tty_settings.h
transform progs $(srcdir) $(HEADER_DEPS) transform.h
+tty_settings progs $(srcdir) $(HEADER_DEPS) tty_settings.h
# vile:makemode
Index: progs/reset_cmd.c
Prereq: 1.9
--- ncurses-6.0-20161217+/progs/reset_cmd.c 2016-10-23 01:08:11.000000000 +0000
+++ ncurses-6.0-20161224/progs/reset_cmd.c 2016-12-24 23:20:57.000000000 +0000
@@ -31,6 +31,7 @@
****************************************************************************/
#include <reset_cmd.h>
+#include <tty_settings.h>
#include <errno.h>
#include <stdio.h>
@@ -51,7 +52,7 @@
#include <sys/ptem.h>
#endif
-MODULE_ID("$Id: reset_cmd.c,v 1.9 2016/10/23 01:08:11 tom Exp $")
+MODULE_ID("$Id: reset_cmd.c,v 1.11 2016/12/24 23:20:57 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
@@ -73,11 +74,8 @@
# endif
#endif
-static int my_fd;
static FILE *my_file;
-static TTY original_settings;
-static bool can_restore = FALSE;
static bool use_reset = FALSE; /* invoked as reset */
static bool use_init = FALSE; /* invoked as init */
@@ -105,17 +103,6 @@
}
static bool
-get_tty_settings(int fd, TTY * tty_settings)
-{
- bool success = TRUE;
- my_fd = fd;
- if (fd < 0 || GET_TTY(my_fd, tty_settings) < 0) {
- success = FALSE;
- }
- return success;
-}
-
-static bool
cat_file(char *file)
{
FILE *fp;
@@ -215,13 +202,9 @@
* a child program dies in raw mode.
*/
void
-reset_tty_settings(TTY * tty_settings)
+reset_tty_settings(int fd, TTY * tty_settings)
{
-#ifdef TERMIOS
- tcgetattr(my_fd, tty_settings);
-#else
- stty(my_fd, tty_settings);
-#endif
+ GET_TTY(fd, tty_settings);
#ifdef TERMIOS
#if defined(VDISCARD) && defined(CDISCARD)
@@ -355,7 +338,7 @@
);
#endif
- SET_TTY(my_fd, tty_settings);
+ SET_TTY(fd, tty_settings);
}
/*
@@ -487,7 +470,7 @@
/* Output startup string. */
bool
-send_init_strings(TTY * old_settings)
+send_init_strings(int fd GCC_UNUSED, TTY * old_settings)
{
int i;
bool need_flush = FALSE;
@@ -497,7 +480,7 @@
if (old_settings != 0 &&
old_settings->c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) {
old_settings->c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET);
- SET_TTY(my_fd, old_settings);
+ SET_TTY(fd, old_settings);
}
#endif
if (use_reset || use_init) {
@@ -626,40 +609,6 @@
show_tty_change(old_settings, new_settings, "Interrupt", VINTR, CINTR);
}
-/*
- * Open a file descriptor on the current terminal, to obtain its settings.
- * stderr is less likely to be redirected than stdout; try that first.
- */
-int
-save_tty_settings(TTY * tty_settings)
-{
- 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");
- }
- can_restore = TRUE;
- original_settings = *tty_settings;
- return my_fd;
-}
-
-void
-restore_tty_settings(void)
-{
- if (can_restore)
- SET_TTY(my_fd, &original_settings);
-}
-
-/* Set the modes if they've changed. */
-void
-update_tty_settings(TTY * old_settings, TTY * new_settings)
-{
- if (memcmp(new_settings, old_settings, sizeof(TTY))) {
- SET_TTY(my_fd, new_settings);
- }
-}
-
#if HAVE_SIZECHANGE
/*
* Set window size if not set already, but update our copy of the values if the
Index: progs/reset_cmd.h
Prereq: 1.6
--- ncurses-6.0-20161217+/progs/reset_cmd.h 2016-10-22 23:34:37.000000000 +0000
+++ ncurses-6.0-20161224/progs/reset_cmd.h 2016-12-24 18:08:48.000000000 +0000
@@ -31,7 +31,7 @@
****************************************************************************/
/*
- * $Id: reset_cmd.h,v 1.6 2016/10/22 23:34:37 tom Exp $
+ * $Id: reset_cmd.h,v 1.7 2016/12/24 18:08:48 tom Exp $
*
* Utility functions for resetting terminal.
*/
@@ -46,16 +46,13 @@
#undef CTRL
#define CTRL(x) ((x) & 0x1f)
-extern bool send_init_strings(TTY * /* old_settings */);
-extern int save_tty_settings(TTY * /* tty_settings */);
+extern bool send_init_strings(int /* fd */, TTY * /* old_settings */);
extern void print_tty_chars(TTY * /* old_settings */, TTY * /* new_settings */);
extern void reset_flush(void);
extern void reset_start(FILE * /* fp */, bool /* is_reset */, bool /* is_init */ );
-extern void reset_tty_settings(TTY * /* tty_settings */);
-extern void restore_tty_settings(void);
+extern void reset_tty_settings(int /* fd */, TTY * /* tty_settings */);
extern void set_control_chars(TTY * /* tty_settings */, int /* erase */, int /* intr */, int /* kill */);
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 */, short * /* high */, short * /* wide */);
Index: progs/tput.c
Prereq: 1.63
--- ncurses-6.0-20161217+/progs/tput.c 2016-10-23 01:08:28.000000000 +0000
+++ ncurses-6.0-20161224/progs/tput.c 2016-12-24 18:44:32.000000000 +0000
@@ -48,8 +48,9 @@
#include <termsort.c>
#endif
#include <transform.h>
+#include <tty_settings.h>
-MODULE_ID("$Id: tput.c,v 1.63 2016/10/23 01:08:28 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.65 2016/12/24 18:44:32 tom Exp $")
#define PUTS(s) fputs(s, stdout)
@@ -117,7 +118,7 @@
}
static int
-tput_cmd(int argc, char *argv[])
+tput_cmd(int fd, TTY * saved_settings, int argc, char *argv[])
{
NCURSES_CONST char *name;
char *s;
@@ -128,29 +129,27 @@
name = check_aliases(argv[0], FALSE);
if (is_reset || is_init) {
- TTY mode, oldmode;
+ TTY oldmode;
int terasechar = -1; /* new erase character */
int intrchar = -1; /* new interrupt character */
int tkillchar = -1; /* new kill character */
- int my_fd = save_tty_settings(&mode);
-
reset_start(stdout, is_reset, is_init);
- reset_tty_settings(&mode);
+ reset_tty_settings(fd, saved_settings);
#if HAVE_SIZECHANGE
- set_window_size(my_fd, &lines, &columns);
+ set_window_size(fd, &lines, &columns);
#else
- (void) my_fd;
+ (void) fd;
#endif
- set_control_chars(&mode, terasechar, intrchar, tkillchar);
- set_conversions(&mode);
- if (send_init_strings(&oldmode)) {
+ set_control_chars(saved_settings, terasechar, intrchar, tkillchar);
+ set_conversions(saved_settings);
+ if (send_init_strings(fd, &oldmode)) {
reset_flush();
}
- update_tty_settings(&oldmode, &mode);
+ update_tty_settings(&oldmode, saved_settings);
return 0;
}
@@ -262,6 +261,8 @@
int c;
char buf[BUFSIZ];
int result = 0;
+ int fd;
+ TTY tty_settings;
prg_name = check_aliases(_nc_rootname(argv[0]), TRUE);
@@ -302,13 +303,15 @@
if (term == 0 || *term == '\0')
quit(2, "No value for $TERM and no -T specified");
- if (setupterm(term, STDOUT_FILENO, &errret) != OK && errret <= 0)
+ fd = save_tty_settings(&tty_settings);
+
+ if (setupterm(term, fd, &errret) != OK && errret <= 0)
quit(3, "unknown terminal \"%s\"", term);
if (cmdline) {
if ((argc <= 0) && !(is_clear || is_reset || is_init))
usage();
- ExitProgram(tput_cmd(argc, argv));
+ ExitProgram(tput_cmd(fd, &tty_settings, argc, argv));
}
while (fgets(buf, sizeof(buf), stdin) != 0) {
@@ -329,7 +332,7 @@
argvec[argnum] = 0;
if (argnum != 0
- && tput_cmd(argnum, argvec) != 0) {
+ && tput_cmd(fd, &tty_settings, argnum, argvec) != 0) {
if (result == 0)
result = 4; /* will return value >4 */
++result;
Index: progs/tset.c
Prereq: 1.113
--- ncurses-6.0-20161217+/progs/tset.c 2016-10-22 23:34:47.000000000 +0000
+++ ncurses-6.0-20161224/progs/tset.c 2016-12-24 18:46:42.000000000 +0000
@@ -88,6 +88,7 @@
#include <reset_cmd.h>
#include <termcap.h>
#include <transform.h>
+#include <tty_settings.h>
#if HAVE_GETTTYNAM && HAVE_TTYENT_H
#include <ttyent.h>
@@ -96,7 +97,7 @@
char *ttyname(int fd);
#endif
-MODULE_ID("$Id: tset.c,v 1.113 2016/10/22 23:34:47 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.115 2016/12/24 18:46:42 tom Exp $")
#ifndef environ
extern char **environ;
@@ -627,7 +628,7 @@
ttype = askuser(0);
}
/* Find the terminfo entry. If it doesn't exist, ask the user. */
- while (setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, &errret)
+ while (setupterm((NCURSES_CONST char *) ttype, fd, &errret)
!= OK) {
if (errret == 0) {
(void) fprintf(stderr, "%s: unknown terminal type %s\n",
@@ -834,7 +835,7 @@
if (same_program(_nc_progname, PROG_RESET)) {
reset_start(stderr, TRUE, FALSE);
- reset_tty_settings(&mode);
+ reset_tty_settings(my_fd, &mode);
} else {
reset_start(stderr, FALSE, FALSE);
}
@@ -852,7 +853,7 @@
set_conversions(&mode);
if (!noinit) {
- if (send_init_strings(&oldmode)) {
+ if (send_init_strings(my_fd, &oldmode)) {
(void) putc('\r', stderr);
(void) fflush(stderr);
(void) napms(1000); /* Settle the terminal. */
Index: progs/tty_settings.c
--- /dev/null 2016-12-24 13:33:57.595999725 +0000
+++ ncurses-6.0-20161224/progs/tty_settings.c 2016-12-24 19:31:11.000000000 +0000
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * 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 *
+ ****************************************************************************/
+
+#define USE_LIBTINFO
+#include <tty_settings.h>
+
+#include <fcntl.h>
+
+MODULE_ID("$Id: tty_settings.c,v 1.2 2016/12/24 19:31:11 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];
+
+ _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();
+ /* NOTREACHED */
+}
+
+static bool
+get_tty_settings(int fd, TTY * tty_settings)
+{
+ bool success = TRUE;
+ my_fd = fd;
+ if (fd < 0 || GET_TTY(my_fd, tty_settings) < 0) {
+ success = FALSE;
+ }
+ return success;
+}
+
+/*
+ * Open a file descriptor on the current terminal, to obtain its settings.
+ * stderr is less likely to be redirected than stdout; try that first.
+ */
+int
+save_tty_settings(TTY * tty_settings)
+{
+ 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");
+ }
+ can_restore = TRUE;
+ original_settings = *tty_settings;
+ return my_fd;
+}
+
+void
+restore_tty_settings(void)
+{
+ if (can_restore)
+ SET_TTY(my_fd, &original_settings);
+}
+
+/* Set the modes if they've changed. */
+void
+update_tty_settings(TTY * old_settings, TTY * new_settings)
+{
+ if (memcmp(new_settings, old_settings, sizeof(TTY))) {
+ SET_TTY(my_fd, new_settings);
+ }
+}
Index: progs/tty_settings.h
--- /dev/null 2016-12-24 13:33:57.595999725 +0000
+++ ncurses-6.0-20161224/progs/tty_settings.h 2016-12-24 18:17:44.000000000 +0000
@@ -0,0 +1,50 @@
+/****************************************************************************
+ * 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: tty_settings.h,v 1.1 2016/12/24 18:17:44 tom Exp $
+ *
+ * Utility functions for saving/restoring terminal settings.
+ */
+#ifndef TTY_SETTINGS_H
+#define TTY_SETTINGS_H 1
+/* *INDENT-OFF* */
+
+#include <progs.priv.h>
+
+extern int save_tty_settings(TTY * /* tty_settings */ );
+extern void restore_tty_settings(void);
+extern void update_tty_settings(TTY * /* old_settings */, TTY * /* new_settings */ );
+
+/* *INDENT-ON* */
+
+#endif /* TTY_SETTINGS_H */