Ejemplo n.º 1
0
Archivo: tui.c Proyecto: 0mp/freebsd
/* TUI readline command.
   Switch the output mode between TUI/standard gdb.  */
static int
tui_rl_switch_mode (int notused1, int notused2)
{
  if (tui_active)
    {
      tui_disable ();
      rl_prep_terminal (0);
    }
  else
    {
      rl_deprep_terminal ();
      tui_enable ();
    }

  /* Clear the readline in case switching occurred in middle of something.  */
  if (rl_end)
    rl_kill_text (0, rl_end);

  /* Since we left the curses mode, the terminal mode is restored to
     some previous state.  That state may not be suitable for readline
     to work correctly (it may be restored in line mode).  We force an
     exit of the current readline so that readline is re-entered and it
     will be able to setup the terminal for its needs.  By re-entering
     in readline, we also redisplay its prompt in the non-curses mode.  */
  rl_newline (1, '\n');

  /* Make sure the \n we are returning does not repeat the last command.  */
  dont_repeat ();
  return 0;
}
Ejemplo n.º 2
0
/* Turn the current line into a comment in shell history.
   A K*rn shell style function. */
int
rl_vi_comment (int count, int key)
{
  rl_beg_of_line (0, 0);

  if (rl_vi_comment_begin != (char *)NULL)
    rl_insert_text (rl_vi_comment_begin);
  else
    rl_insert_text (VI_COMMENT_BEGIN_DEFAULT);	/* Default. */

  rl_redisplay ();
  rl_newline (1, '\n');
  return (0);
}
Ejemplo n.º 3
0
int
octave_rl_newline (int count, int key)
{
  return rl_newline (count, key);
}
Ejemplo n.º 4
0
static gint
readline_status_quit (gint count, gint key)
{
	/* Let readline_status_callback above be called: */
	return rl_newline (count, key);
}
Ejemplo n.º 5
0
/* What to do in the case of C-d. */
int
rl_vi_eof_maybe (int count, int c)
{
  return (rl_newline (1, '\n'));
}