summaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index 86299f5..41b6f19 100644
--- a/terminal.c
+++ b/terminal.c
@@ -152,6 +152,10 @@ static int term_has_meta;
static char *_rl_term_mm;
static char *_rl_term_mo;
+/* The sequences to enter and exit standout mode. */
+static char *_rl_term_so;
+static char *_rl_term_se;
+
/* The key sequences output by the arrow keys, if this terminal has any. */
static char *_rl_term_ku;
static char *_rl_term_kd;
@@ -423,6 +427,8 @@ static const struct _tc_string tc_strings[] =
{ "mo", &_rl_term_mo },
{ "nd", &_rl_term_forward_char },
{ "pc", &_rl_term_pc },
+ { "se", &_rl_term_se },
+ { "so", &_rl_term_so },
{ "up", &_rl_term_up },
{ "vb", &_rl_visible_bell },
{ "vs", &_rl_term_vs },
@@ -470,6 +476,7 @@ _rl_init_terminal_io (const char *terminal_name)
_rl_term_goto = _rl_term_pc = _rl_term_ip = (char *)NULL;
_rl_term_ks = _rl_term_ke =_rl_term_vs = _rl_term_ve = (char *)NULL;
_rl_term_kh = _rl_term_kH = _rl_term_at7 = _rl_term_kI = (char *)NULL;
+ _rl_term_so = _rl_term_se = (char *)NULL;
#if defined(HACK_TERMCAP_MOTION)
_rl_term_forward_char = (char *)NULL;
#endif
@@ -534,6 +541,7 @@ _rl_init_terminal_io (const char *terminal_name)
_rl_term_mm = _rl_term_mo = (char *)NULL;
_rl_term_ve = _rl_term_vs = (char *)NULL;
_rl_term_forward_char = (char *)NULL;
+ _rl_term_so = _rl_term_se = (char *)NULL;
_rl_terminal_can_insert = term_has_meta = 0;
/* Reasonable defaults for tgoto(). Readline currently only uses
@@ -554,7 +562,7 @@ _rl_init_terminal_io (const char *terminal_name)
BC = _rl_term_backspace;
UP = _rl_term_up;
- if (!_rl_term_cr)
+ if (_rl_term_cr == 0)
_rl_term_cr = "\r";
_rl_term_autowrap = TGETFLAG ("am") && TGETFLAG ("xn");
@@ -689,6 +697,16 @@ rl_crlf (void)
return 0;
}
+void
+_rl_cr (void)
+{
+#if defined (__MSDOS__)
+ putc ('\r', rl_outstream);
+#else
+ tputs (_rl_term_cr, 1, _rl_output_character_function);
+#endif
+}
+
/* Ring the terminal bell. */
int
rl_ding (void)
@@ -723,6 +741,30 @@ rl_ding (void)
/* **************************************************************** */
/* */
+/* Entering and leaving terminal standout mode */
+/* */
+/* **************************************************************** */
+
+void
+_rl_standout_on (void)
+{
+#ifndef __MSDOS__
+ if (_rl_term_so && _rl_term_se)
+ tputs (_rl_term_so, 1, _rl_output_character_function);
+#endif
+}
+
+void
+_rl_standout_off (void)
+{
+#ifndef __MSDOS__
+ if (_rl_term_so && _rl_term_se)
+ tputs (_rl_term_se, 1, _rl_output_character_function);
+#endif
+}
+
+/* **************************************************************** */
+/* */
/* Controlling the Meta Key and Keypad */
/* */
/* **************************************************************** */