Home | History | Annotate | Download | only in libedit
History log of /src/lib/libedit/tty.c
RevisionDateAuthorComments
 1.70  14-Jul-2021  christos Via Jess Thrysoee, from Adrian Bunk: Fix libedit build on Linux/Alpha
Alpha is the only Linux architecture that has SIGINFO:
https://sources.debian.org/src/manpages/5.10-1/man7/signal.7/#L522

But even on Alpha Ctrl-T is not supported, and therefore no VSTATUS:
https://sources.debian.org/src/manpages/5.10-1/man3/termios.3/#L603-L608

For consistency check both signal existence and character existence
 1.69  31-May-2020  christos use strlcpy() instead of strncpy() for gcc happiness
 1.68  02-Dec-2018  christos Add a couple more readline compat functions.
 1.67  01-Jan-2018  christos branches: 1.67.2; 1.67.4;
Only FLUSH if we are ending libedit; DRAIN if we suspend for readline.
This allows pasting multiline buffers (Gerry Swislow)
 1.66  05-Sep-2017  christos For readline emulation, don't reset the tty to "sane" (cooked) mode if we
did not start this way. Also set and reset the tty on entry and exit from
readline() since this is what readline does.
 1.65  09-May-2016  christos s/protected/libedit_private/g
 1.64  18-Apr-2016  christos From Ingo Schwarze:
* Replace fcns.c by a shorter and simpler func.h
and include it only in the one file needing it, map.c.
* Combine help.h and help.c into a simplified help.h
and include it only in the one file needing it, map.c.
* Check the very simple, static files editline.c, historyn.c, and
tokenizern.c into CVS rather than needlessly generating them.
* So we no longer autogenerate any C files. :-)
* Shorten and simplify makelist by deleting the options -n, -e, -bc,
and -m; the latter was unused and useless in the first place.
* Move the declaration of el_func_t from fcns.h to the header
actually needing it, map.h. Since that header is already
included by el.h for unrelated reasons, that makes el_func_t
just as globally available as before.
* No longer include the simplified fcns.h into el.h,
include it directly into the *.c files needing it.
 1.63  11-Apr-2016  christos Get rid of private/public; keep protected (Ingo Schwarze)
 1.62  11-Apr-2016  christos Char -> wchar_t from Ingo Schwarze.
 1.61  11-Apr-2016  christos more macro WIDECHAR undoing from Ingo Schwarze.
 1.60  09-Apr-2016  christos More WIDECHAR elimination (Ingo Schwarze)
 1.59  22-Mar-2016  christos Fix reversed condition in tty_end() (Ingo Schwarze)
Also don't succeed if calling setup twice.
 1.58  27-Feb-2016  christos PR/50863: John Hein: libedit el_end() messes up term settings if piped
Keep track if we initialized the tty, and only reset it if we did.
 1.57  17-Feb-2016  christos whitespace and header sorting changes (Ingo Schwarze). No functional changes.
 1.56  16-Feb-2016  christos More header cleanups from Ingo Schwarze.
 1.55  16-Feb-2016  christos more include file cleanup (Ingo Schwarze)
 1.54  16-Feb-2016  christos From Ingo Scharze:
Let "el.h" include everything needed for struct editline,
and don't include that stuff multiple times. That also improves
consistency, also avoids circular inclusions, and also makes it
easier to follow what is going on, even though not quite as nice.
But it seems like the best we can do...
 1.53  16-Feb-2016  christos cleanup chartype.h includes (Ingo Schwarze)
 1.52  16-Feb-2016  christos cleanup inclusion of histedit.h (Ingo Schwarze)
 1.51  14-Feb-2016  christos From Ingo Schwarze:

As we have seen before, "histedit.h" can never get rid of including
the <wchar.h> header because using the data types defined there is
deeply ingrained in the public interfaces of libedit.

Now POSIX unconditionally requires that <wchar.h> defines the type
wint_t. Consequently, it can be used unconditionally, no matter
whether WIDECHAR is active or not. Consequently, the #define Int
is pointless.

Note that removing it is not gratuitious churn. Auditing for
integer signedness problems is already hard when only fundamental
types like "int" and "unsigned" are involved. It gets very hard
when types come into the picture that have platform-dependent
signedness, like "char" and "wint_t". Adding yet another layer
on top, changing both the signedness and the width in a platform-
dependent way, makes auditing yet harder, which IMHO is really
dangerous. Note that while removing the #define, i already found
one bug caused by this excessive complication - in the function
re_putc() in refresh.c. If WIDECHAR was defined, it printed an
Int = wint_t value with %c. Fortunately, that bug only affects
debugging, not production. The fix is contained in the patch.

With WIDECHAR, this doesn't change anything. For the case without
WIDECHAR, i checked that none of the places wants to store values
that might not fit in wint_t.

This only changes internal interfaces; public ones remain unchanged.
 1.50  11-Feb-2016  christos - Add some more Char casts
- reduce ifdefs by providing empty defs for nls functions (Ingo Schwarze)
 1.49  08-Dec-2015  gson unbreak the build
 1.48  08-Dec-2015  christos If we did not setup the tty, don't reset it.
 1.47  14-May-2015  christos fix warnings on ubuntu 32 bit (Miki Rozloznik)
 1.46  18-Jun-2014  christos Add stdlib.h for abort() (Jess Thrysoee)
 1.45  19-May-2014  christos PR/48821: If called from tty_stty(), recalculate flags.
 1.44  19-May-2014  christos more tty modes refactoring, no functional change intended.
 1.43  19-May-2014  christos Factor out some common code (more to be done) from PR/48821
 1.42  15-May-2012  christos branches: 1.42.2; 1.42.8;
save and restore the tty settings on entry and exit respectively.
cleanup debugging printfs.
 1.41  04-Oct-2011  christos branches: 1.41.2;

fixed warnings where wint_t is unsigned.
 1.40  16-Aug-2011  christos re-enable -Wconversion
 1.39  29-Jul-2011  christos kill ifdef notdef
 1.38  29-Jul-2011  christos KNF return (\1); -> return \1;
 1.37  28-Jul-2011  christos Rename key to keymacro to avoid conflicts with term.h. The renaming of term
to terminal was again to avoid conflicts with term.h. term.h is a moving
namespace violation.
 1.36  28-Jul-2011  christos term -> terminal
 1.35  28-Jan-2011  christos fix pasto
 1.34  27-Jan-2011  christos don't turn on editing if stdout is not a tty.
 1.33  18-Apr-2010  christos branches: 1.33.2;
ffs needs strings.h
 1.32  30-Dec-2009  christos Wide character support (UTF-8) from Johny Mattsson; currently disabled.
 1.31  22-Jul-2009  christos Don't depend on side effects inside an assert
From Michael Cook mcook at bbn dot com
 1.30  16-Feb-2009  christos fix sign compare issues.
 1.29  15-Feb-2009  christos pass lint on _LP64.
 1.28  06-Feb-2009  sketch branches: 1.28.2;
Needs errno.h
 1.27  10-Sep-2008  christos Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects. Mostly from Preston A. Elder.
 1.26  30-Jul-2008  christos handle EINTR in the termios operations, reported by the GHC folks
 1.25  18-Mar-2006  christos branches: 1.25.20;
Coverity CID 597: remove dead code.
 1.24  18-Mar-2006  christos Coverity CID 1216: Prevent negative index use.
 1.23  01-Jun-2005  lukem Don't use non-standard uint or u_int.
 1.22  29-May-2005  christos PR/25694: Luke Mewburn: Don't abuse unconstify'ing a string and writing to
it, because you'll core dump. Also remove extra const that gives pain to
the irix compiler.
 1.21  13-Aug-2004  mycroft Delete-previous-char and delete-next-char without an argument are not supposed
to modify the yank buffer in Emacs. Make it so.
 1.20  18-Oct-2003  christos remove debugging printf.
 1.19  18-Oct-2003  christos Allow setty to set chars using char=value
 1.18  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.17  19-Jun-2003  christos From michael@moria.de:
- use __attribute__((__unused__)) in arguments where appropriate.
- some int -> size_t and char * to const char * conversions.
 1.16  18-Mar-2002  christos - constify; passes all gcc and lint strict checks.
- add config.h [Jason Evans], to create a portable version of libedit that
can be easily compiled on other OS's.
 1.15  17-May-2001  christos PR/12963:Jason Waterman: Fix signed cast problems.
 1.14  09-Jan-2001  jdolecek make constant arrays a const
 1.13  04-Sep-2000  lukem convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
 1.12  02-Aug-1999  sommerfeld Fix PR7685 (gdb under emacs prints spurious ^M and messes up terminal)
plus a few bogons noted along the way:
1) Set EDIT_DISABLED if terminal type is emacs.
2) fix bug in NO_TTY mode which caused it to not notice CR or LF
3) implement EDIT_DISABLED within libedit to be somewhat like NO_TTY,
except that a prompt is printed first.
 1.11  02-Jul-1999  simonb More trailing white space.
 1.10  07-Feb-1999  christos PR/6957: Wolfgang Helbig: libedit swaps CR and LF control chars.
 1.9  27-Sep-1998  christos Obey incoming tty char settings.
 1.8  20-May-1998  christos change M_* constants to MD_* to avoid clashes with <stream.h>
 1.7  30-Mar-1998  mrg use int rather than char as an array index.
 1.6  20-Oct-1997  scottr Add support for DTR/CTS flow control, from Bill Studenmund.
 1.5  09-Oct-1997  christos PR/4211: Dave Huang: don't lose VSTATUS and VEOL and any other characters that
are VDISABLED by default.
 1.4  06-Jul-1997  christos Fix compiler warnings.
 1.3  11-Apr-1997  christos Portability fixes:
__const -> const
BADSIG -> SIG_ERR
int flags -> u_int flags
#if __STDC__ -> #ifdef __STDC__
 1.2  11-Jan-1997  lukem RCSid police
editline first appeared in 4.4BSD not NetBSD1.0
 1.1  06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  06-May-1994  cgd libedit!
 1.25.20.2  24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.25.20.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.28.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.33.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.41.2.1  23-May-2012  yamt sync with head.
 1.42.8.1  10-Aug-2014  tls Rebase.
 1.42.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.67.4.1  10-Jun-2019  christos Sync with HEAD
 1.67.2.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts

RSS XML Feed