Bash-4.4 distribution sources and documentation

This commit is contained in:
Chet Ramey 2016-09-15 16:59:08 -04:00
commit a0c0a00fc4
588 changed files with 130746 additions and 80164 deletions

View file

@ -1,10 +1,10 @@
/* rltty.c -- functions to prepare and restore the terminal for readline's
use. */
/* Copyright (C) 1992-2005 Free Software Foundation, Inc.
/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
for reading lines of text with interactive input and history editing.
Readline is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -37,11 +37,11 @@
#include "rldefs.h"
#if defined (GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL */
#include "rltty.h"
#if defined (HAVE_SYS_IOCTL_H)
# include <sys/ioctl.h> /* include for declaration of ioctl */
#endif
#include "readline.h"
#include "rlprivate.h"
@ -60,7 +60,13 @@ static void set_winsize PARAMS((int));
/* */
/* **************************************************************** */
/* Non-zero means that the terminal is in a prepped state. */
/* Non-zero means that the terminal is in a prepped state. There are several
flags that are OR'd in to denote whether or not we have sent various
init strings to the terminal. */
#define TPX_PREPPED 0x01
#define TPX_BRACKPASTE 0x02
#define TPX_METAKEY 0x04
static int terminal_prepped;
static _RL_TTY_CHARS _rl_tty_chars, _rl_last_tty_chars;
@ -595,7 +601,7 @@ void
rl_prep_terminal (meta_flag)
int meta_flag;
{
int tty;
int tty, nprep;
TIOTYPE tio;
if (terminal_prepped)
@ -642,7 +648,7 @@ rl_prep_terminal (meta_flag)
/* If editing in vi mode, make sure we set the bindings in the
insertion keymap no matter what keymap we ended up in. */
if (rl_editing_mode == vi_mode)
_rl_bind_tty_special_chars (vi_insertion_keymap, tio);
_rl_bind_tty_special_chars (vi_insertion_keymap, tio);
else
#endif
_rl_bind_tty_special_chars (_rl_keymap, tio);
@ -659,8 +665,16 @@ rl_prep_terminal (meta_flag)
if (_rl_enable_keypad)
_rl_control_keypad (1);
nprep = TPX_PREPPED;
if (_rl_enable_bracketed_paste)
{
fprintf (rl_outstream, BRACK_PASTE_INIT);
nprep |= TPX_BRACKPASTE;
}
fflush (rl_outstream);
terminal_prepped = 1;
terminal_prepped = nprep;
RL_SETSTATE(RL_STATE_TERMPREPPED);
_rl_release_sigint ();
@ -672,7 +686,7 @@ rl_deprep_terminal ()
{
int tty;
if (!terminal_prepped)
if (terminal_prepped == 0)
return;
/* Try to keep this function from being interrupted. */
@ -680,6 +694,9 @@ rl_deprep_terminal ()
tty = rl_instream ? fileno (rl_instream) : fileno (stdin);
if (terminal_prepped & TPX_BRACKPASTE)
fprintf (rl_outstream, BRACK_PASTE_FINI);
if (_rl_enable_keypad)
_rl_control_keypad (0);
@ -697,6 +714,19 @@ rl_deprep_terminal ()
_rl_release_sigint ();
}
#endif /* !NO_TTY_DRIVER */
/* Set readline's idea of whether or not it is echoing output to the terminal,
returning the old value. */
int
rl_tty_set_echoing (u)
int u;
{
int o;
o = _rl_echoing_p;
_rl_echoing_p = u;
return o;
}
/* **************************************************************** */
/* */
@ -859,6 +889,11 @@ _rl_bind_tty_special_chars (kmap, ttybuff)
# endif /* VLNEXT && TERMIOS_TTY_DRIVER */
# if defined (VWERASE) && defined (TERMIOS_TTY_DRIVER)
# if defined (VI_MODE)
if (rl_editing_mode == vi_mode)
SET_SPECIAL (VWERASE, rl_vi_unix_word_rubout);
else
# endif
SET_SPECIAL (VWERASE, rl_unix_word_rubout);
# endif /* VWERASE && TERMIOS_TTY_DRIVER */
}