summaryrefslogtreecommitdiff
path: root/rltty.c
diff options
context:
space:
mode:
Diffstat (limited to 'rltty.c')
-rw-r--r--rltty.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/rltty.c b/rltty.c
index 636e7f7..cc0dc03 100644
--- a/rltty.c
+++ b/rltty.c
@@ -52,6 +52,11 @@ extern int errno;
rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
+static void block_sigint PARAMS((void));
+static void release_sigint PARAMS((void));
+
+static void set_winsize PARAMS((int));
+
/* **************************************************************** */
/* */
/* Signal Management */
@@ -173,6 +178,14 @@ struct bsdtty {
static TIOTYPE otio;
+static void save_tty_chars PARAMS((TIOTYPE *));
+static int _get_tty_settings PARAMS((int, TIOTYPE *));
+static int get_tty_settings PARAMS((int, TIOTYPE *));
+static int _set_tty_settings PARAMS((int, TIOTYPE *));
+static int set_tty_settings PARAMS((int, TIOTYPE *));
+
+static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *));
+
static void
save_tty_chars (tiop)
TIOTYPE *tiop;
@@ -379,6 +392,14 @@ prepare_terminal_settings (meta_flag, oldtio, tiop)
static TIOTYPE otio;
+static void save_tty_chars PARAMS((TIOTYPE *));
+static int _get_tty_settings PARAMS((int, TIOTYPE *));
+static int get_tty_settings PARAMS((int, TIOTYPE *));
+static int _set_tty_settings PARAMS((int, TIOTYPE *));
+static int set_tty_settings PARAMS((int, TIOTYPE *));
+
+static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *));
+
#if defined (FLUSHO)
# define OUTPUT_BEING_FLUSHED(tp) (tp->c_lflag & FLUSHO)
#else
@@ -626,6 +647,7 @@ rl_prep_terminal (meta_flag)
if (get_tty_settings (tty, &tio) < 0)
{
release_sigint ();
+fprintf(stderr, "readline: warning: rl_prep_terminal: cannot get terminal settings");
return;
}
@@ -771,8 +793,8 @@ rltty_set_default_bindings (kmap)
{ \
int ic; \
ic = sc; \
- if (ic != -1 && kmap[ic].type == ISFUNC) \
- kmap[ic].function = func; \
+ if (ic != -1 && kmap[(unsigned char)ic].type == ISFUNC) \
+ kmap[(unsigned char)ic].function = func; \
} \
while (0)
@@ -861,6 +883,7 @@ _rl_disable_tty_signals ()
nosigstty = sigstty;
nosigstty.c_lflag &= ~ISIG;
+ nosigstty.c_iflag &= ~IXON;
if (_set_tty_settings (fileno (rl_instream), &nosigstty) < 0)
return (_set_tty_settings (fileno (rl_instream), &sigstty));
@@ -872,10 +895,17 @@ _rl_disable_tty_signals ()
int
_rl_restore_tty_signals ()
{
+ int r;
+
if (tty_sigs_disabled == 0)
return 0;
- return (_set_tty_settings (fileno (rl_instream), &sigstty));
+ r = _set_tty_settings (fileno (rl_instream), &sigstty);
+
+ if (r == 0)
+ tty_sigs_disabled = 0;
+
+ return r;
}
#endif /* !NEW_TTY_DRIVER */