+ improve manpages discussing file descriptors in low-level functions.
+ modify flushinp to use file descriptors in SCREEN, rather than from
TERMINAL, and check if they are for a terminal, like SVr4.
+ modify mcprint to use file descriptor in SCREEN, for consistency.
+ add xterm+focus to foot+base (patch by Daniel Ekloef).
+ correct definition of Charable() for non-wide ncurses library (report
and test-case by Zbigniew Baniewski).
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3959 2023/06/03 20:12:53 tom Exp $
+-- $Id: NEWS,v 1.3962 2023/06/10 16:51:20 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20230610
+ + improve manpages discussing file descriptors in low-level functions.
+ + modify flushinp to use file descriptors in SCREEN, rather than from
+ TERMINAL, and check if they are for a terminal, like SVr4.
+ + modify mcprint to use file descriptor in SCREEN, for consistency.
+ + add xterm+focus to foot+base (patch by Daniel Ekloef).
+ + correct definition of Charable() for non-wide ncurses library (report
+ and test-case by Zbigniew Baniewski).
+
20230603
+ add configure option --with-strip-program, to override program
chosen by the install program for stripping executables (prompted
-5:0:10 6.4 20230603
+5:0:10 6.4 20230610
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1547 2023/06/03 09:47:46 tom Exp $
+# $Id: dist.mk,v 1.1548 2023/06/10 10:03:51 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 4
-NCURSES_PATCH = 20230603
+NCURSES_PATCH = 20230610
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
</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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG>xterm(1)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
<!--
****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_initscr.3x,v 1.39 2022/07/24 15:46:49 tom Exp @
+ * @Id: curs_initscr.3x,v 1.40 2023/06/10 16:50:22 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<STRONG>bool</STRONG> <STRONG>isendwin(void);</STRONG>
- <STRONG>SCREEN</STRONG> <STRONG>*newterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>type</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>outfd</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>infd</EM><STRONG>);</STRONG>
+ <STRONG>SCREEN</STRONG> <STRONG>*newterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>type</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>outf</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>inf</EM><STRONG>);</STRONG>
<STRONG>SCREEN</STRONG> <STRONG>*set_term(SCREEN</STRONG> <STRONG>*</STRONG><EM>new</EM><STRONG>);</STRONG>
<STRONG>void</STRONG> <STRONG>delscreen(SCREEN*</STRONG> <EM>sp</EM><STRONG>);</STRONG>
routine for each terminal instead of <STRONG>initscr</STRONG>. A program that needs to
inspect capabilities, so it can continue to run in a line-oriented mode
if the terminal cannot support a screen-oriented program, would also
- use <STRONG>newterm</STRONG>. The routine <STRONG>newterm</STRONG> should be called once for each termi-
- nal. It returns a variable of type <STRONG>SCREEN</STRONG> <STRONG>*</STRONG> which should be saved as a
- reference to that terminal. <STRONG>newterm</STRONG>'s arguments are
+ use <STRONG>newterm</STRONG>.
+
+ The routine <STRONG>newterm</STRONG> should be called once for each terminal. It re-
+ turns a variable of type <STRONG>SCREEN</STRONG> <STRONG>*</STRONG> which should be saved as a reference
+ to that terminal. <STRONG>newterm</STRONG>'s arguments are
<STRONG>o</STRONG> the <EM>type</EM> of the terminal to be used in place of <STRONG>$TERM</STRONG>,
- <STRONG>o</STRONG> a file pointer for output to the terminal, and
+ <STRONG>o</STRONG> an output stream connected to the terminal, and
- <STRONG>o</STRONG> another file pointer for input from the terminal
+ <STRONG>o</STRONG> an input stream connected to the terminal
If the <EM>type</EM> parameter is <STRONG>NULL</STRONG>, <STRONG>$TERM</STRONG> will be used.
+ The file descriptor of the output stream is passed to <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>,
+ which returns a pointer to a <STRONG>TERMINAL</STRONG> structure. <STRONG>newterm</STRONG>'s return val-
+ ue holds a pointer to the <STRONG>TERMINAL</STRONG> structure.
+
</PRE><H3><a name="h3-endwin">endwin</a></H3><PRE>
The program must also call <STRONG>endwin</STRONG> for each terminal being used before
the SVr4 model, deleting only the standard <STRONG>WINDOW</STRONG> structures.
+</PRE><H3><a name="h3-High-level-versus-low-level">High-level versus low-level</a></H3><PRE>
+ Different implementations may disagree regarding the level of some
+ functions. For example, <STRONG>SCREEN</STRONG> (returned by <STRONG>newterm</STRONG>) and <STRONG>TERMINAL</STRONG> (re-
+ turned by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>) hold file descriptors for the output stream.
+ If an application switches screens using <STRONG>set_term</STRONG>, or switches termi-
+ nals using <STRONG><A HREF="curs_terminfo.3x.html">set_curterm(3x)</A></STRONG>, applications which use the output file de-
+ scriptor can have different behavior depending on which structure holds
+ the corresponding descriptor.
+
+ For example
+
+ <STRONG>o</STRONG> NetBSD's <STRONG><A HREF="curs_termattrs.3x.html">baudrate(3x)</A></STRONG> function uses the descriptor in <STRONG>TERMINAL</STRONG>.
+ <STRONG>ncurses</STRONG> and SVr4 use the descriptor in <STRONG>SCREEN</STRONG>.
+
+ <STRONG>o</STRONG> NetBSD and <STRONG>ncurses</STRONG> use the descriptor in <STRONG>TERMINAL</STRONG> for terminal I/O
+ modes, e.g., <STRONG><A HREF="curs_kernel.3x.html">def_shell_mode(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">def_prog_mode(3x)</A></STRONG>. SVr4 curses
+ uses the descriptor in <STRONG>SCREEN</STRONG>.
+
+
</PRE><H3><a name="h3-Unset-TERM-Variable">Unset TERM Variable</a></H3><PRE>
- If the TERM variable is missing or empty, <STRONG>initscr</STRONG> uses the value "un-
+ If the TERM variable is missing or empty, <STRONG>initscr</STRONG> uses the value "un-
known", which normally corresponds to a terminal entry with the <EM>generic</EM>
- (<EM>gn</EM>) capability. Generic entries are detected by <STRONG>setupterm</STRONG> (see
- <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>) and cannot be used for full-screen operation. Other
- implementations may handle a missing/empty TERM variable differently.
+ (<EM>gn</EM>) capability. Generic entries are detected by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG> and
+ cannot be used for full-screen operation. Other implementations may
+ handle a missing/empty TERM variable differently.
</PRE><H3><a name="h3-Signal-Handlers">Signal Handlers</a></H3><PRE>
Quoting from X/Open Curses, section 3.1.1:
- <EM>Curses</EM> <EM>implementations</EM> <EM>may</EM> <EM>provide</EM> <EM>for</EM> <EM>special</EM> <EM>handling</EM> <EM>of</EM> <EM>the</EM>
- <STRONG>SIGINT</STRONG><EM>,</EM> <STRONG>SIGQUIT</STRONG> <EM>and</EM> <STRONG>SIGTSTP</STRONG> <EM>signals</EM> <EM>if</EM> <EM>their</EM> <EM>disposition</EM> <EM>is</EM>
+ <EM>Curses</EM> <EM>implementations</EM> <EM>may</EM> <EM>provide</EM> <EM>for</EM> <EM>special</EM> <EM>handling</EM> <EM>of</EM> <EM>the</EM>
+ <STRONG>SIGINT</STRONG><EM>,</EM> <STRONG>SIGQUIT</STRONG> <EM>and</EM> <STRONG>SIGTSTP</STRONG> <EM>signals</EM> <EM>if</EM> <EM>their</EM> <EM>disposition</EM> <EM>is</EM>
<STRONG>SIG_DFL</STRONG> <EM>at</EM> <EM>the</EM> <EM>time</EM> <STRONG>initscr</STRONG> <EM>is</EM> <EM>called</EM> ...
- <EM>Any</EM> <EM>special</EM> <EM>handling</EM> <EM>for</EM> <EM>these</EM> <EM>signals</EM> <EM>may</EM> <EM>remain</EM> <EM>in</EM> <EM>effect</EM> <EM>for</EM>
+ <EM>Any</EM> <EM>special</EM> <EM>handling</EM> <EM>for</EM> <EM>these</EM> <EM>signals</EM> <EM>may</EM> <EM>remain</EM> <EM>in</EM> <EM>effect</EM> <EM>for</EM>
<EM>the</EM> <EM>life</EM> <EM>of</EM> <EM>the</EM> <EM>process</EM> <EM>or</EM> <EM>until</EM> <EM>the</EM> <EM>process</EM> <EM>changes</EM> <EM>the</EM>
<EM>disposition</EM> <EM>of</EM> <EM>the</EM> <EM>signal.</EM>
- <EM>None</EM> <EM>of</EM> <EM>the</EM> <EM>Curses</EM> <EM>functions</EM> <EM>are</EM> <EM>required</EM> <EM>to</EM> <EM>be</EM> <EM>safe</EM> <EM>with</EM> <EM>respect</EM>
+ <EM>None</EM> <EM>of</EM> <EM>the</EM> <EM>Curses</EM> <EM>functions</EM> <EM>are</EM> <EM>required</EM> <EM>to</EM> <EM>be</EM> <EM>safe</EM> <EM>with</EM> <EM>respect</EM>
<EM>to</EM> <EM>signals</EM> ...
- This implementation establishes signal handlers during initialization,
+ This implementation establishes signal handlers during initialization,
e.g., <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>. Applications which must handle these signals
- should set up the corresponding handlers <EM>after</EM> initializing the li-
+ should set up the corresponding handlers <EM>after</EM> initializing the li-
brary:
<STRONG>SIGINT</STRONG>
- The handler <EM>attempts</EM> to cleanup the screen on exit. Although it
+ The handler <EM>attempts</EM> to cleanup the screen on exit. Although it
<EM>usually</EM> works as expected, there are limitations:
- <STRONG>o</STRONG> Walking the <STRONG>SCREEN</STRONG> list is unsafe, since all list management
+ <STRONG>o</STRONG> Walking the <STRONG>SCREEN</STRONG> list is unsafe, since all list management
is done without any signal blocking.
<STRONG>o</STRONG> On systems which have <STRONG>REENTRANT</STRONG> turned on, <STRONG>set_term</STRONG> uses func-
library functions which are clearly unsafe.
<STRONG>SIGTERM</STRONG>
- This uses the same handler as <STRONG>SIGINT</STRONG>, with the same limitations.
- It is not mentioned in X/Open Curses, but is more suitable for
+ This uses the same handler as <STRONG>SIGINT</STRONG>, with the same limitations.
+ It is not mentioned in X/Open Curses, but is more suitable for
this purpose than <STRONG>SIGQUIT</STRONG> (which is used in debugging).
<STRONG>SIGTSTP</STRONG>
- This handles the <EM>stop</EM> signal, used in job control. When resuming
- the process, this implementation discards pending input with
- <STRONG>flushinput</STRONG> (see <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>), and repaints the screen assuming
- that it has been completely altered. It also updates the saved
+ This handles the <EM>stop</EM> signal, used in job control. When resuming
+ the process, this implementation discards pending input with
+ <STRONG>flushinput</STRONG> (see <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>), and repaints the screen assuming
+ that it has been completely altered. It also updates the saved
terminal modes with <STRONG>def_shell_mode</STRONG> (see <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>).
<STRONG>SIGWINCH</STRONG>
- This handles the window-size changes which were ignored in the
- standardization efforts. The handler sets a (signal-safe) vari-
- able which is later tested in <STRONG>wgetch</STRONG> (see <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>). If
- <STRONG>keypad</STRONG> has been enabled for the corresponding window, <STRONG>wgetch</STRONG> re-
- turns the key symbol <STRONG>KEY_RESIZE</STRONG>. At the same time, <STRONG>wgetch</STRONG> calls
- <STRONG>resizeterm</STRONG> to adjust the standard screen <STRONG>stdscr</STRONG>, and update other
+ This handles the window-size changes which were ignored in the
+ standardization efforts. The handler sets a (signal-safe) vari-
+ able which is later tested in <STRONG>wgetch</STRONG> (see <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>). If
+ <STRONG>keypad</STRONG> has been enabled for the corresponding window, <STRONG>wgetch</STRONG> re-
+ turns the key symbol <STRONG>KEY_RESIZE</STRONG>. At the same time, <STRONG>wgetch</STRONG> calls
+ <STRONG>resizeterm</STRONG> to adjust the standard screen <STRONG>stdscr</STRONG>, and update other
data such as <STRONG>LINES</STRONG> and <STRONG>COLS</STRONG>.
</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_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>, <STRONG>curs_ter-</STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>, <STRONG>curs_ter-</STRONG>
<STRONG><A HREF="curs_terminfo.3x.html">minfo(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
<li><a href="#h2-PORTABILITY">PORTABILITY</a>
<ul>
<li><a href="#h3-Differences">Differences</a></li>
+<li><a href="#h3-High-level-versus-low-level">High-level versus low-level</a></li>
<li><a href="#h3-Unset-TERM-Variable">Unset TERM Variable</a></li>
<li><a href="#h3-Signal-Handlers">Signal Handlers</a></li>
</ul>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_terminfo.3x,v 1.85 2023/04/23 20:52:38 tom Exp @
+ * @Id: curs_terminfo.3x,v 1.87 2023/06/10 15:51:45 tom Exp @
* ***************************************************************************
* ***************************************************************************
* ***************************************************************************
environment variable <STRONG>TERM</STRONG> is used.
<EM>filedes</EM>
- is the file descriptor used for all output.
+ is the file descriptor used for getting and setting terminal
+ I/O modes.
+
+ Higher-level applications use <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG> for initializing the
+ terminal, passing an output <EM>stream</EM> rather than a <EM>descriptor</EM>.
+ In curses, the two are the same because <STRONG>newterm</STRONG> calls <STRONG>se-</STRONG>
+ <STRONG>tupterm</STRONG>, passing the file descriptor derived from its output
+ stream parameter.
<EM>errret</EM>
points to an optional location where an error status can be re-
- turned to the caller. If <EM>errret</EM> is not null, then <STRONG>setupterm</STRONG>
- returns <STRONG>OK</STRONG> or <STRONG>ERR</STRONG> and stores a status value in the integer
- pointed to by <EM>errret</EM>. A return value of <STRONG>OK</STRONG> combined with sta-
+ turned to the caller. If <EM>errret</EM> is not null, then <STRONG>setupterm</STRONG>
+ returns <STRONG>OK</STRONG> or <STRONG>ERR</STRONG> and stores a status value in the integer
+ pointed to by <EM>errret</EM>. A return value of <STRONG>OK</STRONG> combined with sta-
tus of <STRONG>1</STRONG> in <EM>errret</EM> is normal.
If <STRONG>ERR</STRONG> is returned, examine <EM>errret</EM>:
- <STRONG>1</STRONG> means that the terminal is hardcopy, cannot be used for
+ <STRONG>1</STRONG> means that the terminal is hardcopy, cannot be used for
curses applications.
- <STRONG>setupterm</STRONG> determines if the entry is a hardcopy type by
+ <STRONG>setupterm</STRONG> determines if the entry is a hardcopy type by
checking the <STRONG>hc</STRONG> (<STRONG>hardcopy</STRONG>) capability.
- <STRONG>0</STRONG> means that the terminal could not be found, or that it is
- a generic type, having too little information for curses
+ <STRONG>0</STRONG> means that the terminal could not be found, or that it is
+ a generic type, having too little information for curses
applications to run.
- <STRONG>setupterm</STRONG> determines if the entry is a generic type by
- checking the <STRONG>gn</STRONG> (<STRONG>generic</STRONG>) capability.
+ <STRONG>setupterm</STRONG> determines if the entry is a generic type by
+ checking the <STRONG>gn</STRONG> (<STRONG>generic_type</STRONG>) capability.
<STRONG>-1</STRONG> means that the <STRONG>terminfo</STRONG> database could not be found.
</PRE><H3><a name="h3-The-Terminal-State">The Terminal State</a></H3><PRE>
- The <STRONG>setupterm</STRONG> routine stores its information about the terminal in a
- <STRONG>TERMINAL</STRONG> structure pointed to by the global variable <STRONG>cur_term</STRONG>. If it
- detects an error, or decides that the terminal is unsuitable (hardcopy
- or generic), it discards this information, making it not available to
+ The <STRONG>setupterm</STRONG> routine stores its information about the terminal in a
+ <STRONG>TERMINAL</STRONG> structure pointed to by the global variable <STRONG>cur_term</STRONG>. If it
+ detects an error, or decides that the terminal is unsuitable (hardcopy
+ or generic), it discards this information, making it not available to
applications.
- If <STRONG>setupterm</STRONG> is called repeatedly for the same terminal type, it will
- reuse the information. It maintains only one copy of a given termi-
- nal's capabilities in memory. If it is called for different terminal
- types, <STRONG>setupterm</STRONG> allocates new storage for each set of terminal capa-
+ If <STRONG>setupterm</STRONG> is called repeatedly for the same terminal type, it will
+ reuse the information. It maintains only one copy of a given termi-
+ nal's capabilities in memory. If it is called for different terminal
+ types, <STRONG>setupterm</STRONG> allocates new storage for each set of terminal capa-
bilities.
- The <STRONG>set_curterm</STRONG> routine sets <STRONG>cur_term</STRONG> to <EM>nterm</EM>, and makes all of the
- <STRONG>terminfo</STRONG> boolean, numeric, and string variables use the values from
+ The <STRONG>set_curterm</STRONG> routine sets <STRONG>cur_term</STRONG> to <EM>nterm</EM>, and makes all of the
+ <STRONG>terminfo</STRONG> boolean, numeric, and string variables use the values from
<EM>nterm</EM>. It returns the old value of <STRONG>cur_term</STRONG>.
- The <STRONG>del_curterm</STRONG> routine frees the space pointed to by <EM>oterm</EM> and makes
+ The <STRONG>del_curterm</STRONG> routine frees the space pointed to by <EM>oterm</EM> and makes
it available for further use. If <EM>oterm</EM> is the same as <STRONG>cur_term</STRONG>, refer-
- ences to any of the <STRONG>terminfo</STRONG> boolean, numeric, and string variables
- thereafter may refer to invalid memory locations until another <STRONG>se-</STRONG>
+ ences to any of the <STRONG>terminfo</STRONG> boolean, numeric, and string variables
+ thereafter may refer to invalid memory locations until another <STRONG>se-</STRONG>
<STRONG>tupterm</STRONG> has been called.
- The <STRONG>restartterm</STRONG> routine is similar to <STRONG>setupterm</STRONG> and <STRONG>initscr</STRONG>, except
+ The <STRONG>restartterm</STRONG> routine is similar to <STRONG>setupterm</STRONG> and <STRONG>initscr</STRONG>, except
that it is called after restoring memory to a previous state (for exam-
- ple, when reloading a game saved as a core image dump). <STRONG>restartterm</STRONG>
- assumes that the windows and the input and output options are the same
- as when memory was saved, but the terminal type and baud rate may be
- different. Accordingly, <STRONG>restartterm</STRONG> saves various tty state bits,
+ ple, when reloading a game saved as a core image dump). <STRONG>restartterm</STRONG>
+ assumes that the windows and the input and output options are the same
+ as when memory was saved, but the terminal type and baud rate may be
+ different. Accordingly, <STRONG>restartterm</STRONG> saves various tty state bits,
calls <STRONG>setupterm</STRONG>, and then restores the bits.
</PRE><H3><a name="h3-Formatting-Output">Formatting Output</a></H3><PRE>
- The <STRONG>tparm</STRONG> routine instantiates the string <EM>str</EM> with parameters <EM>pi</EM>. A
- pointer is returned to the result of <EM>str</EM> with the parameters applied.
- Application developers should keep in mind these quirks of the inter-
+ The <STRONG>tparm</STRONG> routine instantiates the string <EM>str</EM> with parameters <EM>pi</EM>. A
+ pointer is returned to the result of <EM>str</EM> with the parameters applied.
+ Application developers should keep in mind these quirks of the inter-
face:
- <STRONG>o</STRONG> Although <STRONG>tparm</STRONG>'s actual parameters may be integers or strings, the
+ <STRONG>o</STRONG> Although <STRONG>tparm</STRONG>'s actual parameters may be integers or strings, the
prototype expects <STRONG>long</STRONG> (integer) values.
<STRONG>o</STRONG> Aside from the <STRONG>set_attributes</STRONG> (<STRONG>sgr</STRONG>) capability, most terminal capa-
bilities require no more than one or two parameters.
- <STRONG>o</STRONG> Padding information is ignored by <STRONG>tparm</STRONG>; it is interpreted by
+ <STRONG>o</STRONG> Padding information is ignored by <STRONG>tparm</STRONG>; it is interpreted by
<STRONG>tputs</STRONG>.
- <STRONG>o</STRONG> The capability string is null-terminated. Use "\200" where an
+ <STRONG>o</STRONG> The capability string is null-terminated. Use "\200" where an
ASCII NUL is needed in the output.
- <STRONG>tiparm</STRONG> is a newer form of <STRONG>tparm</STRONG> which uses <EM><stdarg.h></EM> rather than a
+ <STRONG>tiparm</STRONG> is a newer form of <STRONG>tparm</STRONG> which uses <EM><stdarg.h></EM> rather than a
fixed-parameter list. Its numeric parameters are integers (int) rather
than longs.
- Both <STRONG>tparm</STRONG> and <STRONG>tiparm</STRONG> assume that the application passes parameters
- consistent with the terminal description. Two extensions are provided
+ Both <STRONG>tparm</STRONG> and <STRONG>tiparm</STRONG> assume that the application passes parameters
+ consistent with the terminal description. Two extensions are provided
as alternatives to deal with untrusted data:
- <STRONG>o</STRONG> <STRONG>tiparm_s</STRONG> is an extension which is a safer formatting function than
+ <STRONG>o</STRONG> <STRONG>tiparm_s</STRONG> is an extension which is a safer formatting function than
<STRONG>tparm</STRONG> or <STRONG>tiparm</STRONG>, because it allows the developer to tell the curses
- library how many parameters to expect in the parameter list, and
+ library how many parameters to expect in the parameter list, and
which may be string parameters.
- The <EM>mask</EM> parameter has one bit set for each of the parameters (up
+ The <EM>mask</EM> parameter has one bit set for each of the parameters (up
to 9) which will be passed as char* rather than numbers.
- <STRONG>o</STRONG> The extension <STRONG>tiscan_s</STRONG> allows the application to inspect a format-
+ <STRONG>o</STRONG> The extension <STRONG>tiscan_s</STRONG> allows the application to inspect a format-
ting capability to see what the curses library would assume.
</PRE><H3><a name="h3-Output-Functions">Output Functions</a></H3><PRE>
- The <STRONG>tputs</STRONG> routine applies padding information (i.e., by interpreting
- marker embedded in the terminfo capability such as "$<5>" as 5 mil-
+ The <STRONG>tputs</STRONG> routine applies padding information (i.e., by interpreting
+ marker embedded in the terminfo capability such as "$<5>" as 5 mil-
liseconds) to the string <EM>str</EM> and outputs it:
- <STRONG>o</STRONG> The <EM>str</EM> parameter must be a terminfo string variable or the return
+ <STRONG>o</STRONG> The <EM>str</EM> parameter must be a terminfo string variable or the return
value from <STRONG>tparm</STRONG>, <STRONG>tiparm</STRONG>, <STRONG>tgetstr</STRONG>, or <STRONG>tgoto</STRONG>.
- The <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
- which happens to share this function name with the <EM>terminfo</EM> inter-
+ The <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
+ which happens to share this function name with the <EM>terminfo</EM> inter-
face.
<STRONG>o</STRONG> <EM>affcnt</EM> is the number of lines affected, or 1 if not applicable.
- <STRONG>o</STRONG> <EM>putc</EM> is a <STRONG>putchar</STRONG>-like routine to which the characters are passed,
+ <STRONG>o</STRONG> <EM>putc</EM> is a <STRONG>putchar</STRONG>-like routine to which the characters are passed,
one at a time.
- The <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>. The output of <STRONG>putp</STRONG> al-
+ The <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>. The output of <STRONG>putp</STRONG> al-
ways goes to <STRONG>stdout</STRONG>, rather than the <EM>filedes</EM> specified in <STRONG>setupterm</STRONG>.
- The <STRONG>vidputs</STRONG> routine displays the string on the terminal in the video
+ The <STRONG>vidputs</STRONG> routine displays the string on the terminal in the video
attribute mode <EM>attrs</EM>, which is any combination of the attributes listed
- in <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. The characters are passed to the <STRONG>putchar</STRONG>-like routine
+ in <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. The characters are passed to the <STRONG>putchar</STRONG>-like routine
<EM>putc</EM>.
The <STRONG>vidattr</STRONG> routine is like the <STRONG>vidputs</STRONG> routine, except that it outputs
through <STRONG>putchar</STRONG>.
- The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines correspond to vidattr and vidputs,
- respectively. They use a set of arguments for representing the video
+ The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines correspond to vidattr and vidputs,
+ respectively. They use a set of arguments for representing the video
attributes plus color, i.e.,
<STRONG>o</STRONG> <EM>attrs</EM> of type <STRONG>attr_t</STRONG> for the attributes and
<STRONG>o</STRONG> <EM>pair</EM> of type <STRONG>short</STRONG> for the color-pair number.
- The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines are designed to use the attribute
+ The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines are designed to use the attribute
constants with the <STRONG>WA_</STRONG> prefix.
- X/Open Curses reserves the <EM>opts</EM> argument for future use, saying that
- applications must provide a null pointer for that argument. As an ex-
- tension, this implementation allows <EM>opts</EM> to be used as a pointer to
+ X/Open Curses reserves the <EM>opts</EM> argument for future use, saying that
+ applications must provide a null pointer for that argument. As an ex-
+ tension, this implementation allows <EM>opts</EM> to be used as a pointer to
<STRONG>int</STRONG>, which overrides the <EM>pair</EM> (<STRONG>short</STRONG>) argument.
- The <STRONG>mvcur</STRONG> routine provides low-level cursor motion. It takes effect
- immediately (rather than at the next refresh).
+ The <STRONG>mvcur</STRONG> routine provides low-level cursor motion. It takes effect
+ immediately (rather than at the next refresh). Unlike the other low-
+ level output functions, which either write to the standard output or
+ pass an output function parameter, <STRONG>mvcur</STRONG> uses an output file descriptor
+ derived from the output stream parameter of <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG>.
While <STRONG>putp</STRONG> and <STRONG>mvcur</STRONG> are low-level functions which do not use the high-
level curses state, they are declared in <STRONG><curses.h></STRONG> because SystemV did
mvcur low level cursor motion
putp utility function that uses <STRONG>tputs</STRONG> to send char-
acters via <STRONG>putchar</STRONG>.
-
resetterm set tty modes to "out of curses" state
resetty reset tty flags to stored value
saveterm save current modes as "in curses" state
<STRONG>o</STRONG> <STRONG>setupterm</STRONG> interprets a missing/empty TERM variable as the special
value "unknown".
+ SVr4 curses uses the special value "dumb".
+
+ The difference between the two is that the former uses the <STRONG>gn</STRONG>
+ (<STRONG>generic_type</STRONG>) terminfo capability, while the latter does not. A
+ generic terminal is unsuitable for full-screen applications.
+
<STRONG>o</STRONG> <STRONG>setupterm</STRONG> allows explicit use of the the windows console driver by
checking if $TERM is set to "#win32con" or an abbreviation of that
string.
<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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</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="tic.1m.html">tic(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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
method of updating character screens with reasonable optimization.
This implementation is "new curses" (ncurses) and is the approved
replacement for 4.4BSD classic curses, which has been discontinued.
- This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
The <STRONG>ncurses</STRONG> library emulates the curses library of System V Release 4
UNIX, and XPG4 (X/Open Portability Guide) curses (also known as XSI
</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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</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="tset.1.html">tset(1)</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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences.
- This manual describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This manual describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(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>. <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<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="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
<!--
****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: tset.1,v 1.62 2022/02/12 20:02:20 tom Exp @
+ * @Id: tset.1,v 1.63 2023/06/10 15:46:24 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
and systems using that convention, <STRONG>getty(1)</STRONG> does this job by setting
<STRONG>TERM</STRONG> according to the type passed to it by <EM>/etc/inittab</EM>.)
- 4. The default terminal type, "unknown".
+ 4. The default terminal type, "unknown", is not suitable for curses
+ applications.
- If the terminal type was not specified on the command-line, the <STRONG>-m</STRONG>
+ If the terminal type was not specified on the command-line, the <STRONG>-m</STRONG>
option mappings are then applied (see the section <STRONG>TERMINAL</STRONG> <STRONG>TYPE</STRONG> <STRONG>MAPPING</STRONG>
- for more information). Then, if the terminal type begins with a
- question mark ("?"), the user is prompted for confirmation of the
- terminal type. An empty response confirms the type, or, another type
- can be entered to specify a new type. Once the terminal type has been
+ for more information). Then, if the terminal type begins with a
+ question mark ("?"), the user is prompted for confirmation of the
+ terminal type. An empty response confirms the type, or, another type
+ can be entered to specify a new type. Once the terminal type has been
determined, the terminal description for the terminal is retrieved. If
no terminal description is found for the type, the user is prompted for
another terminal type.
Once the terminal description is retrieved,
- <STRONG>o</STRONG> if the "<STRONG>-w</STRONG>" option is enabled, <STRONG>tset</STRONG> may update the terminal's
+ <STRONG>o</STRONG> if the "<STRONG>-w</STRONG>" option is enabled, <STRONG>tset</STRONG> may update the terminal's
window size.
- If the window size cannot be obtained from the operating system,
- but the terminal description (or environment, e.g., <STRONG>LINES</STRONG> and
- <STRONG>COLUMNS</STRONG> variables specify this), use this to set the operating
+ If the window size cannot be obtained from the operating system,
+ but the terminal description (or environment, e.g., <STRONG>LINES</STRONG> and
+ <STRONG>COLUMNS</STRONG> variables specify this), use this to set the operating
system's notion of the window size.
- <STRONG>o</STRONG> if the "<STRONG>-c</STRONG>" option is enabled, the backspace, interrupt and line
+ <STRONG>o</STRONG> if the "<STRONG>-c</STRONG>" option is enabled, the backspace, interrupt and line
kill characters (among many other things) are set
- <STRONG>o</STRONG> unless the "<STRONG>-I</STRONG>" option is enabled, the terminal and tab
- <EM>initialization</EM> strings are sent to the standard error output, and
+ <STRONG>o</STRONG> unless the "<STRONG>-I</STRONG>" option is enabled, the terminal and tab
+ <EM>initialization</EM> strings are sent to the standard error output, and
<STRONG>tset</STRONG> waits one second (in case a hardware reset was issued).
- <STRONG>o</STRONG> Finally, if the erase, interrupt and line kill characters have
- changed, or are not set to their default values, their values are
+ <STRONG>o</STRONG> Finally, if the erase, interrupt and line kill characters have
+ changed, or are not set to their default values, their values are
displayed to the standard error output.
<STRONG>o</STRONG> resets any unset special characters to their default values
before doing the terminal initialization described above. Also, rather
- than using the terminal <EM>initialization</EM> strings, it uses the terminal
+ than using the terminal <EM>initialization</EM> strings, it uses the terminal
<EM>reset</EM> strings.
- The <STRONG>reset</STRONG> command is useful after a program dies leaving a terminal in
+ The <STRONG>reset</STRONG> command is useful after a program dies leaving a terminal in
an abnormal state:
<STRONG>o</STRONG> you may have to type
<EM><LF></EM><STRONG>reset</STRONG><EM><LF></EM>
(the line-feed character is normally control-J) to get the terminal
- to work, as carriage-return may no longer work in the abnormal
+ to work, as carriage-return may no longer work in the abnormal
state.
<STRONG>o</STRONG> Also, the terminal will often not echo the command.
<STRONG>-e</STRONG> <EM>ch</EM>
Set the erase character to <EM>ch</EM>.
- <STRONG>-I</STRONG> Do not send the terminal or tab initialization strings to the
+ <STRONG>-I</STRONG> Do not send the terminal or tab initialization strings to the
terminal.
<STRONG>-i</STRONG> <EM>ch</EM>
Specify a mapping from a port type to a terminal. See the section
<STRONG>TERMINAL</STRONG> <STRONG>TYPE</STRONG> <STRONG>MAPPING</STRONG> for more information.
- <STRONG>-Q</STRONG> Do not display any values for the erase, interrupt and line kill
- characters. Normally <STRONG>tset</STRONG> displays the values for control
+ <STRONG>-Q</STRONG> Do not display any values for the erase, interrupt and line kill
+ characters. Normally <STRONG>tset</STRONG> displays the values for control
characters which differ from the system's default values.
- <STRONG>-q</STRONG> The terminal type is displayed to the standard output, and the
- terminal is not initialized in any way. The option "-" by itself
+ <STRONG>-q</STRONG> The terminal type is displayed to the standard output, and the
+ terminal is not initialized in any way. The option "-" by itself
is equivalent but archaic.
<STRONG>-r</STRONG> Print the terminal type to the standard error output.
<STRONG>-V</STRONG> reports the version of ncurses which was used in this program, and
exits.
- <STRONG>-w</STRONG> Resize the window to match the size deduced via <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
- Normally this has no effect, unless <STRONG>setupterm</STRONG> is not able to
+ <STRONG>-w</STRONG> Resize the window to match the size deduced via <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>.
+ Normally this has no effect, unless <STRONG>setupterm</STRONG> is not able to
detect the window size.
- The arguments for the <STRONG>-e</STRONG>, <STRONG>-i</STRONG>, and <STRONG>-k</STRONG> options may either be entered as
- actual characters or by using the "hat" notation, i.e., control-h may
+ The arguments for the <STRONG>-e</STRONG>, <STRONG>-i</STRONG>, and <STRONG>-k</STRONG> options may either be entered as
+ actual characters or by using the "hat" notation, i.e., control-h may
be specified as "^H" or "^h".
If neither <STRONG>-c</STRONG> or <STRONG>-w</STRONG> is given, both options are assumed.
</PRE><H2><a name="h2-SETTING-THE-ENVIRONMENT">SETTING THE ENVIRONMENT</a></H2><PRE>
- It is often desirable to enter the terminal type and information about
+ It is often desirable to enter the terminal type and information about
the terminal's capabilities into the shell's environment. This is done
using the <STRONG>-s</STRONG> option.
- When the <STRONG>-s</STRONG> option is specified, the commands to enter the information
- into the shell's environment are written to the standard output. If
- the <STRONG>SHELL</STRONG> environmental variable ends in "csh", the commands are for
- <STRONG>csh</STRONG>, otherwise, they are for <STRONG>sh(1)</STRONG>. Note, the <STRONG>csh</STRONG> commands set and
- unset the shell variable <STRONG>noglob</STRONG>, leaving it unset. The following line
- in the <STRONG>.login</STRONG> or <STRONG>.profile</STRONG> files will initialize the environment
+ When the <STRONG>-s</STRONG> option is specified, the commands to enter the information
+ into the shell's environment are written to the standard output. If
+ the <STRONG>SHELL</STRONG> environmental variable ends in "csh", the commands are for
+ <STRONG>csh</STRONG>, otherwise, they are for <STRONG>sh(1)</STRONG>. Note, the <STRONG>csh</STRONG> commands set and
+ unset the shell variable <STRONG>noglob</STRONG>, leaving it unset. The following line
+ in the <STRONG>.login</STRONG> or <STRONG>.profile</STRONG> files will initialize the environment
correctly:
eval `tset -s options ... `
</PRE><H2><a name="h2-TERMINAL-TYPE-MAPPING">TERMINAL TYPE MAPPING</a></H2><PRE>
- When the terminal is not hardwired into the system (or the current
- system information is incorrect) the terminal type derived from the
- <EM>/etc/ttys</EM> file or the <STRONG>TERM</STRONG> environmental variable is often something
- generic like <STRONG>network</STRONG>, <STRONG>dialup</STRONG>, or <STRONG>unknown</STRONG>. When <STRONG>tset</STRONG> is used in a
- startup script it is often desirable to provide information about the
+ When the terminal is not hardwired into the system (or the current
+ system information is incorrect) the terminal type derived from the
+ <EM>/etc/ttys</EM> file or the <STRONG>TERM</STRONG> environmental variable is often something
+ generic like <STRONG>network</STRONG>, <STRONG>dialup</STRONG>, or <STRONG>unknown</STRONG>. When <STRONG>tset</STRONG> is used in a
+ startup script it is often desirable to provide information about the
type of terminal used on such ports.
- The <STRONG>-m</STRONG> options maps from some set of conditions to a terminal type,
+ The <STRONG>-m</STRONG> options maps from some set of conditions to a terminal type,
that is, to tell <STRONG>tset</STRONG> "If I'm on this port at a particular speed, guess
that I'm on that kind of terminal".
- The argument to the <STRONG>-m</STRONG> option consists of an optional port type, an
- optional operator, an optional baud rate specification, an optional
- colon (":") character and a terminal type. The port type is a string
- (delimited by either the operator or the colon character). The
- operator may be any combination of ">", "<", "@", and "!"; ">" means
- greater than, "<" means less than, "@" means equal to and "!" inverts
- the sense of the test. The baud rate is specified as a number and is
- compared with the speed of the standard error output (which should be
+ The argument to the <STRONG>-m</STRONG> option consists of an optional port type, an
+ optional operator, an optional baud rate specification, an optional
+ colon (":") character and a terminal type. The port type is a string
+ (delimited by either the operator or the colon character). The
+ operator may be any combination of ">", "<", "@", and "!"; ">" means
+ greater than, "<" means less than, "@" means equal to and "!" inverts
+ the sense of the test. The baud rate is specified as a number and is
+ compared with the speed of the standard error output (which should be
the control terminal). The terminal type is a string.
- If the terminal type is not specified on the command line, the <STRONG>-m</STRONG>
- mappings are applied to the terminal type. If the port type and baud
- rate match the mapping, the terminal type specified in the mapping
- replaces the current type. If more than one mapping is specified, the
+ If the terminal type is not specified on the command line, the <STRONG>-m</STRONG>
+ mappings are applied to the terminal type. If the port type and baud
+ rate match the mapping, the terminal type specified in the mapping
+ replaces the current type. If more than one mapping is specified, the
first applicable mapping is used.
- For example, consider the following mapping: <STRONG>dialup>9600:vt100</STRONG>. The
+ For example, consider the following mapping: <STRONG>dialup>9600:vt100</STRONG>. The
port type is dialup , the operator is >, the baud rate specification is
9600, and the terminal type is vt100. The result of this mapping is to
- specify that if the terminal type is <STRONG>dialup</STRONG>, and the baud rate is
+ specify that if the terminal type is <STRONG>dialup</STRONG>, and the baud rate is
greater than 9600 baud, a terminal type of <STRONG>vt100</STRONG> will be used.
- If no baud rate is specified, the terminal type will match any baud
- rate. If no port type is specified, the terminal type will match any
- port type. For example, <STRONG>-m</STRONG> <STRONG>dialup:vt100</STRONG> <STRONG>-m</STRONG> <STRONG>:?xterm</STRONG> will cause any
+ If no baud rate is specified, the terminal type will match any baud
+ rate. If no port type is specified, the terminal type will match any
+ port type. For example, <STRONG>-m</STRONG> <STRONG>dialup:vt100</STRONG> <STRONG>-m</STRONG> <STRONG>:?xterm</STRONG> will cause any
dialup port, regardless of baud rate, to match the terminal type vt100,
- and any non-dialup port type to match the terminal type ?xterm. Note,
- because of the leading question mark, the user will be queried on a
+ and any non-dialup port type to match the terminal type ?xterm. Note,
+ because of the leading question mark, the user will be queried on a
default port as to whether they are actually using an xterm terminal.
- No whitespace characters are permitted in the <STRONG>-m</STRONG> option argument.
- Also, to avoid problems with meta-characters, it is suggested that the
+ No whitespace characters are permitted in the <STRONG>-m</STRONG> option argument.
+ Also, to avoid problems with meta-characters, it is suggested that the
entire <STRONG>-m</STRONG> option argument be placed within single quote characters, and
- that <STRONG>csh</STRONG> users insert a backslash character ("\") before any
+ that <STRONG>csh</STRONG> users insert a backslash character ("\") before any
exclamation marks ("!").
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
- A <STRONG>reset</STRONG> command appeared in 1BSD (March 1978), written by Kurt Shoens.
- This program set the <EM>erase</EM> and <EM>kill</EM> characters to <STRONG>^H</STRONG> (backspace) and <STRONG>@</STRONG>
+ A <STRONG>reset</STRONG> command appeared in 1BSD (March 1978), written by Kurt Shoens.
+ This program set the <EM>erase</EM> and <EM>kill</EM> characters to <STRONG>^H</STRONG> (backspace) and <STRONG>@</STRONG>
respectively. Mark Horton improved that in 3BSD (October 1979), adding
- <EM>intr</EM>, <EM>quit</EM>, <EM>start</EM>/<EM>stop</EM> and <EM>eof</EM> characters as well as changing the
- program to avoid modifying any user settings. That version of <STRONG>reset</STRONG>
+ <EM>intr</EM>, <EM>quit</EM>, <EM>start</EM>/<EM>stop</EM> and <EM>eof</EM> characters as well as changing the
+ program to avoid modifying any user settings. That version of <STRONG>reset</STRONG>
did not use the termcap database.
- A separate <STRONG>tset</STRONG> command was provided in 1BSD by Eric Allman, using the
- termcap database. Allman's comments in the source code indicate that
+ A separate <STRONG>tset</STRONG> command was provided in 1BSD by Eric Allman, using the
+ termcap database. Allman's comments in the source code indicate that
he began work in October 1977, continuing development over the next few
years.
According to comments in the source code, the <STRONG>tset</STRONG> program was modified
- in September 1980, to use logic copied from the 3BSD "reset" when it
+ in September 1980, to use logic copied from the 3BSD "reset" when it
was invoked as <STRONG>reset</STRONG>. This version appeared in 4.1cBSD, late in 1982.
Other developers (e.g., Keith Bostic and Jim Bloom) continued to modify
<STRONG>tset</STRONG> until 4.4BSD was released in 1993.
- The <STRONG>ncurses</STRONG> implementation was lightly adapted from the 4.4BSD sources
+ The <STRONG>ncurses</STRONG> implementation was lightly adapted from the 4.4BSD sources
for a terminfo environment by Eric S. Raymond <esr@snark.thyrsus.com>.
</PRE><H2><a name="h2-COMPATIBILITY">COMPATIBILITY</a></H2><PRE>
- Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7
+ Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7
(POSIX.1-2008) nor X/Open Curses Issue 7 documents <STRONG>tset</STRONG> or <STRONG>reset</STRONG>.
- The AT&T <STRONG>tput</STRONG> utility (AIX, HPUX, Solaris) incorporated the terminal-
- mode manipulation as well as termcap-based features such as resetting
- tabstops from <STRONG>tset</STRONG> in BSD (4.1c), presumably with the intention of
- making <STRONG>tset</STRONG> obsolete. However, each of those systems still provides
- <STRONG>tset</STRONG>. In fact, the commonly-used <STRONG>reset</STRONG> utility is always an alias for
+ The AT&T <STRONG>tput</STRONG> utility (AIX, HPUX, Solaris) incorporated the terminal-
+ mode manipulation as well as termcap-based features such as resetting
+ tabstops from <STRONG>tset</STRONG> in BSD (4.1c), presumably with the intention of
+ making <STRONG>tset</STRONG> obsolete. However, each of those systems still provides
+ <STRONG>tset</STRONG>. In fact, the commonly-used <STRONG>reset</STRONG> utility is always an alias for
<STRONG>tset</STRONG>.
- The <STRONG>tset</STRONG> utility provides for backward-compatibility with BSD
- environments (under most modern UNIXes, <STRONG>/etc/inittab</STRONG> and <STRONG>getty(1)</STRONG> can
- set <STRONG>TERM</STRONG> appropriately for each dial-up line; this obviates what was
- <STRONG>tset</STRONG>'s most important use). This implementation behaves like 4.4BSD
+ The <STRONG>tset</STRONG> utility provides for backward-compatibility with BSD
+ environments (under most modern UNIXes, <STRONG>/etc/inittab</STRONG> and <STRONG>getty(1)</STRONG> can
+ set <STRONG>TERM</STRONG> appropriately for each dial-up line; this obviates what was
+ <STRONG>tset</STRONG>'s most important use). This implementation behaves like 4.4BSD
<STRONG>tset</STRONG>, with a few exceptions specified here.
- A few options are different because the <STRONG>TERMCAP</STRONG> variable is no longer
+ A few options are different because the <STRONG>TERMCAP</STRONG> variable is no longer
supported under terminfo-based <STRONG>ncurses</STRONG>:
- <STRONG>o</STRONG> The <STRONG>-S</STRONG> option of BSD <STRONG>tset</STRONG> no longer works; it prints an error
+ <STRONG>o</STRONG> The <STRONG>-S</STRONG> option of BSD <STRONG>tset</STRONG> no longer works; it prints an error
message to the standard error and dies.
<STRONG>o</STRONG> The <STRONG>-s</STRONG> option only sets <STRONG>TERM</STRONG>, not <STRONG>TERMCAP</STRONG>.
- There was an undocumented 4.4BSD feature that invoking <STRONG>tset</STRONG> via a link
- named "TSET" (or via any other name beginning with an upper-case
+ There was an undocumented 4.4BSD feature that invoking <STRONG>tset</STRONG> via a link
+ named "TSET" (or via any other name beginning with an upper-case
letter) set the terminal to use upper-case only. This feature has been
omitted.
The <STRONG>-A</STRONG>, <STRONG>-E</STRONG>, <STRONG>-h</STRONG>, <STRONG>-u</STRONG> and <STRONG>-v</STRONG> options were deleted from the <STRONG>tset</STRONG> utility in
- 4.4BSD. None of them were documented in 4.3BSD and all are of limited
- utility at best. The <STRONG>-a</STRONG>, <STRONG>-d</STRONG>, and <STRONG>-p</STRONG> options are similarly not
- documented or useful, but were retained as they appear to be in
- widespread use. It is strongly recommended that any usage of these
+ 4.4BSD. None of them were documented in 4.3BSD and all are of limited
+ utility at best. The <STRONG>-a</STRONG>, <STRONG>-d</STRONG>, and <STRONG>-p</STRONG> options are similarly not
+ documented or useful, but were retained as they appear to be in
+ widespread use. It is strongly recommended that any usage of these
three options be changed to use the <STRONG>-m</STRONG> option instead. The <STRONG>-a</STRONG>, <STRONG>-d</STRONG>, and
<STRONG>-p</STRONG> options are therefore omitted from the usage summary above.
- Very old systems, e.g., 3BSD, used a different terminal driver which
- was replaced in 4BSD in the early 1980s. To accommodate these older
- systems, the 4BSD <STRONG>tset</STRONG> provided a <STRONG>-n</STRONG> option to specify that the new
- terminal driver should be used. This implementation does not provide
+ Very old systems, e.g., 3BSD, used a different terminal driver which
+ was replaced in 4BSD in the early 1980s. To accommodate these older
+ systems, the 4BSD <STRONG>tset</STRONG> provided a <STRONG>-n</STRONG> option to specify that the new
+ terminal driver should be used. This implementation does not provide
that choice.
- It is still permissible to specify the <STRONG>-e</STRONG>, <STRONG>-i</STRONG>, and <STRONG>-k</STRONG> options without
+ It is still permissible to specify the <STRONG>-e</STRONG>, <STRONG>-i</STRONG>, and <STRONG>-k</STRONG> options without
arguments, although it is strongly recommended that such usage be fixed
to explicitly specify the character.
- As of 4.4BSD, executing <STRONG>tset</STRONG> as <STRONG>reset</STRONG> no longer implies the <STRONG>-Q</STRONG> option.
+ As of 4.4BSD, executing <STRONG>tset</STRONG> as <STRONG>reset</STRONG> no longer implies the <STRONG>-Q</STRONG> option.
Also, the interaction between the - option and the <EM>terminal</EM> argument in
some historic implementations of <STRONG>tset</STRONG> has been removed.
- The <STRONG>-c</STRONG> and <STRONG>-w</STRONG> options are not found in earlier implementations.
+ The <STRONG>-c</STRONG> and <STRONG>-w</STRONG> options are not found in earlier implementations.
However, a different window size-change feature was provided in 4.4BSD.
- <STRONG>o</STRONG> In 4.4BSD, <STRONG>tset</STRONG> uses the window size from the termcap description
- to set the window size if <STRONG>tset</STRONG> is not able to obtain the window
+ <STRONG>o</STRONG> In 4.4BSD, <STRONG>tset</STRONG> uses the window size from the termcap description
+ to set the window size if <STRONG>tset</STRONG> is not able to obtain the window
size from the operating system.
<STRONG>o</STRONG> In ncurses, <STRONG>tset</STRONG> obtains the window size using <STRONG>setupterm</STRONG>, which may
- be from the operating system, the <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> environment
+ be from the operating system, the <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> environment
variables or the terminal description.
- Obtaining the window size from the terminal description is common to
- both implementations, but considered obsolescent. Its only practical
+ Obtaining the window size from the terminal description is common to
+ both implementations, but considered obsolescent. Its only practical
use is for hardware terminals. Generally speaking, a window size would
- be unset only if there were some problem obtaining the value from the
- operating system (and <STRONG>setupterm</STRONG> would still fail). For that reason,
- the <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> environment variables may be useful for working
- around window-size problems. Those have the drawback that if the
- window is resized, those variables must be recomputed and reassigned.
+ be unset only if there were some problem obtaining the value from the
+ operating system (and <STRONG>setupterm</STRONG> would still fail). For that reason,
+ the <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> environment variables may be useful for working
+ around window-size problems. Those have the drawback that if the
+ window is resized, those variables must be recomputed and reassigned.
To do this more easily, use the <STRONG>resize(1)</STRONG> program.
The <STRONG>tset</STRONG> command uses these environment variables:
SHELL
- tells <STRONG>tset</STRONG> whether to initialize <STRONG>TERM</STRONG> using <STRONG>sh(1)</STRONG> or <STRONG>csh(1)</STRONG>
+ tells <STRONG>tset</STRONG> whether to initialize <STRONG>TERM</STRONG> using <STRONG>sh(1)</STRONG> or <STRONG>csh(1)</STRONG>
syntax.
- TERM Denotes your terminal type. Each terminal type is distinct,
+ TERM Denotes your terminal type. Each terminal type is distinct,
though many are similar.
TERMCAP
- may denote the location of a termcap database. If it is not an
- absolute pathname, e.g., begins with a "/", <STRONG>tset</STRONG> removes the
- variable from the environment before looking for the terminal
+ may denote the location of a termcap database. If it is not an
+ absolute pathname, e.g., begins with a "/", <STRONG>tset</STRONG> removes the
+ variable from the environment before looking for the terminal
description.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
/etc/ttys
- system port name to terminal type mapping database (BSD versions
+ system port name to terminal type mapping database (BSD versions
only).
/usr/share/terminfo
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <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>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.4 (patch 20230423).
+ This describes <STRONG>ncurses</STRONG> version 6.4 (patch 20230610).
.\"***************************************************************************
-.\" Copyright 2018-2021,2022 Thomas E. Dickey *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey *
.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_initscr.3x,v 1.39 2022/07/24 15:46:49 tom Exp $
+.\" $Id: curs_initscr.3x,v 1.40 2023/06/10 16:50:22 tom Exp $
.TH curs_initscr 3X ""
.de bP
.ie n .IP \(bu 4
.sp
\fBbool isendwin(void);\fP
.sp
-\fBSCREEN *newterm(const char *\fItype\fB, FILE *\fIoutfd\fB, FILE *\fIinfd\fB);\fR
+\fBSCREEN *newterm(const char *\fItype\fB, FILE *\fIoutf\fB, FILE *\fIinf\fB);\fR
.br
\fBSCREEN *set_term(SCREEN *\fInew\fB);\fR
.br
so it can continue to run in a line-oriented mode if the
terminal cannot support a screen-oriented program, would also use
\fBnewterm\fP.
+.PP
The routine \fBnewterm\fP should be called once for each terminal.
It returns a variable of type \fBSCREEN *\fP which should be saved
as a reference to that terminal.
.bP
the \fItype\fP of the terminal to be used in place of \fB$TERM\fP,
.bP
-a file pointer for output to the terminal, and
+an output stream connected to the terminal, and
.bP
-another file pointer for input from the terminal
+an input stream connected to the terminal
.PP
If the \fItype\fP parameter is \fBNULL\fP, \fB$TERM\fP will be used.
+.PP
+The file descriptor of the output stream is passed to \fBsetupterm\fP(3X),
+which returns a pointer to a \fBTERMINAL\fP structure.
+\fBnewterm\fP's return value holds a pointer to the \fBTERMINAL\fP structure.
.SS endwin
.PP
The program must also call
NetBSD copied this feature of ncurses in 2001.
PDCurses follows the SVr4 model,
deleting only the standard \fBWINDOW\fP structures.
+.SS High-level versus low-level
+Different implementations may disagree regarding the level of some functions.
+For example, \fBSCREEN\fP (returned by \fBnewterm\fP) and
+\fBTERMINAL\fP (returned by \fBsetupterm\fP(3X)) hold file descriptors for
+the output stream.
+If an application switches screens using \fBset_term\fR,
+or switches terminals using \fBset_curterm\fP(3X),
+applications which use the output file descriptor can have different
+behavior depending on which structure holds the corresponding descriptor.
+.PP
+For example
+.bP
+NetBSD's \fBbaudrate\fP(3X) function uses the descriptor in \fBTERMINAL\fP.
+\fBncurses\fP and SVr4 use the descriptor in \fBSCREEN\fP.
+.bP
+NetBSD and \fBncurses\fP use the descriptor in \fBTERMINAL\fP for terminal I/O modes,
+e.g.,
+\fBdef_shell_mode\fP(3X),
+\fBdef_prog_mode\fP(3X).
+SVr4 curses uses the descriptor in \fBSCREEN\fP.
.SS Unset TERM Variable
.PP
If the TERM variable is missing or empty, \fBinitscr\fP uses the
value \*(``unknown\*('',
which normally corresponds to a terminal entry with the \fIgeneric\fP
(\fIgn\fP) capability.
-Generic entries are detected by \fBsetupterm\fP
-(see curs_terminfo(3X)) and cannot be used for full-screen operation.
+Generic entries are detected by \fBsetupterm\fP(3X)
+and cannot be used for full-screen operation.
Other implementations may handle a missing/empty TERM variable differently.
.SS Signal Handlers
.PP
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_terminfo.3x,v 1.85 2023/04/23 20:52:38 tom Exp $
+.\" $Id: curs_terminfo.3x,v 1.87 2023/06/10 15:51:45 tom Exp $
.TH curs_terminfo 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
If \fIterm\fP is null, the environment variable \fBTERM\fP is used.
.TP 5
\fIfiledes\fP
-is the file descriptor used for all output.
+is the file descriptor used for getting and setting terminal I/O modes.
+.IP
+Higher-level applications use \fBnewterm\fP(3X) for initializing the terminal,
+passing an output \fIstream\fP rather than a \fIdescriptor\fP.
+In curses, the two are the same because \fBnewterm\fP calls \fBsetupterm\fP,
+passing the file descriptor derived from its output stream parameter.
.TP 5
\fIerrret\fP
points to an optional location where an error status can be returned to
having too little information for curses applications to run.
.IP
\fBsetupterm\fP determines if the entry is a generic type by
-checking the \fBgn\fP (\fBgeneric\fP) capability.
+checking the \fBgn\fP (\fBgeneric_type\fP) capability.
.TP 5
.B \-1
means that the \fBterminfo\fP database could not be found.
.PP
The \fBmvcur\fP routine provides low-level cursor motion.
It takes effect immediately (rather than at the next refresh).
+Unlike the other low-level output functions,
+which either write to the standard output or pass an output function parameter,
+\fBmvcur\fP uses an output file descriptor derived from
+the output stream parameter of \fBnewterm\fP(3X).
.PP
While \fBputp\fP and \fBmvcur\fP are low-level functions which
do not use the high-level curses state,
.bP
\fBsetupterm\fP interprets a missing/empty TERM variable as the
special value \*(``unknown\*(''.
+.IP
+SVr4 curses uses the
+special value \*(``dumb\*(''.
+.IP
+The difference between the two is that
+the former uses the \fBgn\fP (\fBgeneric_type\fR) terminfo capability,
+while the latter does not.
+A generic terminal is unsuitable for full-screen applications.
.bP
\fBsetupterm\fP allows explicit use of the
the windows console driver by checking if $TERM is set to
-# $Id: manhtml.aliases,v 1.21 2022/11/26 13:57:22 tom Exp $
+# $Id: manhtml.aliases,v 1.22 2023/06/10 17:09:27 tom Exp $
#***************************************************************************
-# Copyright 2019-2020,2022 Thomas E. Dickey *
+# Copyright 2019-2022,2023 Thomas E. Dickey *
# Copyright 2013,2017 Free Software Foundation, Inc. *
# *
# Permission is hereby granted, free of charge, to any person obtaining a *
# Items in this list will be linked to the corresponding manpages by man2html
addch(3X) curs_addch(3X)
assume_default_colors(3X) default_colors(3X)
+baudrate(3X) curs_termattrs(3X)
clearok(3X) curs_outopts(3X)
curs_set(3X) curs_kernel(3X)
+def_prog_mode(3X) curs_kernel(3X)
+def_shell_mode(3X) curs_kernel(3X)
delscreen(3X) curs_initscr(3X)
doupdate(3X) curs_refresh(3X)
endwin(3X) curs_initscr(3X)
refresh(3X) curs_refresh(3X)
reset_shell_mode(3X) curs_kernel(3X)
restartterm(3X) curs_terminfo(3X)
+set_curterm(3X) curs_terminfo(3X)
set_term(3X) curs_initscr(3X)
setcchar(3X) curs_getcchar(3X)
setupterm(3X) curs_terminfo(3X)
.\"***************************************************************************
-.\" Copyright 2018-2021,2022 Thomas E. Dickey *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey *
.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: tset.1,v 1.62 2022/02/12 20:02:20 tom Exp $
+.\" $Id: tset.1,v 1.63 2023/06/10 15:46:24 tom Exp $
.TH @TSET@ 1 ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
\fBgetty\fP(1) does this job by setting
\fBTERM\fP according to the type passed to it by \fI/etc/inittab\fP.)
.PP
-4. The default terminal type, \*(``unknown\*(''.
+4. The default terminal type, \*(``unknown\*('',
+is not suitable for curses applications.
.PP
If the terminal type was not specified on the command-line, the \fB\-m\fP
option mappings are then applied (see the section
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
-# $Revision: 1.1058 $
-# $Date: 2023/05/08 08:23:18 $
+# $Revision: 1.1059 $
+# $Date: 2023/06/05 21:40:20 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
use=ecma+strikeout, use=xterm+alt+title,
use=xterm+pcfkeys, use=xterm+sm+1006, use=xterm+tmux2,
use=xterm+sl-alt, use=bracketed+paste,
- use=report+version,
+ use=report+version, use=xterm+focus,
######## WEB CLIENTS
# 2023-05-08
# + add mode 1004 to xterm+sm+1006 from xterm #380 -TD
#
+# 2023-06-05
+# + add xterm+focus to foot+base (patch by Daniel Ekloef).
+#
######## SHANTIH! SHANTIH! SHANTIH!
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.668 2023/06/03 12:33:07 tom Exp $
+ * $Id: curses.priv.h,v 1.669 2023/06/06 22:31:04 tom Exp $
*
* curses.priv.h
*
#define isWidecExt(ch) (0)
#define if_WIDEC(code) /* nothing */
-#define Charable(ch) ((ch) >= ' ' && (ch) <= '~')
+#define Charable(ch) (CharOf(ch) >= ' ' && CharOf(ch) <= '~')
#define L(ch) ch
#endif /* } */
/****************************************************************************
- * Copyright 2020,2022 Thomas E. Dickey *
+ * Copyright 2020-2022,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_kernel.c,v 1.35 2022/07/28 20:14:51 tom Exp $")
+MODULE_ID("$Id: lib_kernel.c,v 1.36 2023/06/10 13:29:06 tom Exp $")
#ifdef TERMIOS
static int
}
#endif
+static void
+flush_input(int fd)
+{
+#ifdef TERMIOS
+ tcflush(fd, TCIFLUSH);
+#else /* !TERMIOS */
+ errno = 0;
+ do {
+#if defined(EXP_WIN32_DRIVER)
+ _nc_console_flush(_nc_console_fd2handle(fd));
+#else
+ ioctl(fd, TIOCFLUSH, 0);
+#endif
+ } while
+ (errno == EINTR);
+#endif
+}
+
/*
* flushinp()
*
- * Flush any input on cur_term->Filedes
- *
+ * Flush any input on tty
*/
NCURSES_EXPORT(int)
NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0)
{
- TERMINAL *termp = TerminalOf(SP_PARM);
-
T((T_CALLED("flushinp(%p)"), (void *) SP_PARM));
- if (termp != 0) {
-#ifdef TERMIOS
- tcflush(termp->Filedes, TCIFLUSH);
-#else
- errno = 0;
- do {
-#if defined(EXP_WIN32_DRIVER)
- _nc_console_flush(_nc_console_fd2handle(termp->Filedes));
-#else
- ioctl(termp->Filedes, TIOCFLUSH, 0);
-#endif
- } while
- (errno == EINTR);
-#endif
+ if (SP_PARM != 0) {
+ if (NC_ISATTY(SP_PARM->_ifd))
+ flush_input(SP_PARM->_ifd);
+ else if (NC_ISATTY(SP_PARM->_ofd))
+ flush_input(SP_PARM->_ofd);
if (SP_PARM) {
SP_PARM->_fifohead = -1;
SP_PARM->_fifotail = 0;
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_print.c,v 1.30 2021/04/18 14:58:57 tom Exp $")
+MODULE_ID("$Id: lib_print.c,v 1.31 2023/06/10 12:44:41 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
* data has actually been shipped to the terminal. If the write(2)
* operation is truly atomic we're protected from this.
*/
- result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need);
+ result = (int) write(SP_PARM->_ofd, mybuf, need);
/*
* By giving up our scheduler slot here we increase the odds that the
-ncurses6 (6.4+20230603) unstable; urgency=low
+ncurses6 (6.4+20230610) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 03 Jun 2023 05:47:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 06 Jun 2023 18:27:59 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230603) unstable; urgency=low
+ncurses6 (6.4+20230610) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 03 Jun 2023 05:47:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 06 Jun 2023 18:27:59 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230603) unstable; urgency=low
+ncurses6 (6.4+20230610) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 03 Jun 2023 05:47:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 06 Jun 2023 18:27:59 -0400
ncurses6 (5.9+20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.587 2023/06/03 09:47:46 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.588 2023/06/06 22:27:59 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "4"\r
!define VERSION_YYYY "2023"\r
-!define VERSION_MMDD "0603"\r
+!define VERSION_MMDD "0610"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.4
-Release: 20230603
+Release: 20230610
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.4
-Release: 20230603
+Release: 20230610
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.4
-Release: 20230603
+Release: 20230610
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz