Ejemplo n.º 1
0
/*
 * Call when the terminal's blinking-text settings change, or when
 * a text blink has just occurred.
 */
static void
tblink_cb(void)
{
  term.tblinker = !term.tblinker;
  term_schedule_tblink();
  win_update();
}
Ejemplo n.º 2
0
void
term_reset(void)
{
  term.state = NORMAL;

  term_cursor_reset(&term.curs);
  term_cursor_reset(&term.saved_cursors[0]);
  term_cursor_reset(&term.saved_cursors[1]);

  term.backspace_sends_bs = cfg.backspace_sends_bs;
  term.delete_sends_del = cfg.delete_sends_del;
  if (term.tabs) {
    for (int i = 0; i < term.cols; i++)
      term.tabs[i] = (i % 8 == 0);
  }
  term.rvideo = 0;
  term.in_vbell = false;
  term.cursor_on = true;
  term.echoing = false;
  term.insert = false;
  term.shortcut_override = term.escape_sends_fs = term.app_escape_key = false;
  term.vt220_keys = strstr(cfg.term, "vt220");
  term.app_keypad = term.app_cursor_keys = term.app_wheel = false;
  term.mouse_mode = MM_NONE;
  term.mouse_enc = ME_X10;
  term.wheel_reporting = true;
  term.modify_other_keys = 0;
  term.report_focus = 0;
  term.report_font_changed = 0;
  term.report_ambig_width = 0;
  term.bracketed_paste = false;
  term.show_scrollbar = true;

  term.marg_top = 0;
  term.marg_bot = term.rows - 1;

  term.cursor_type = -1;
  term.cursor_blinks = -1;
  term.blink_is_real = cfg.allow_blinking;
  term.erase_char = basic_erase_char;
  term.on_alt_screen = false;
  term_print_finish();
  if (term.lines) {
    term_switch_screen(1, false);
    term_erase(false, false, true, true);
    term_switch_screen(0, false);
    term_erase(false, false, true, true);
    term.curs.y = term_last_nonempty_line() + 1;
    if (term.curs.y == term.rows) {
      term.curs.y--;
      term_do_scroll(0, term.rows - 1, 1, true);
    }
  }
  term.selected = false;
  term_schedule_tblink();
  term_schedule_cblink();
  term_clear_scrollback();

  win_reset_colours();
}
Ejemplo n.º 3
0
/* Apply changed settings */
void
term_reconfig(void)
{
  if (!*new_cfg.printer)
    term_print_finish();
  if (new_cfg.allow_blinking != cfg.allow_blinking)
    term.blink_is_real = new_cfg.allow_blinking;
  cfg.cursor_blinks = new_cfg.cursor_blinks;
  term_schedule_tblink();
  term_schedule_cblink();
  if (new_cfg.backspace_sends_bs != cfg.backspace_sends_bs)
    term.backspace_sends_bs = new_cfg.backspace_sends_bs;
  if (strcmp(new_cfg.term, cfg.term))
    term.vt220_keys = strstr(new_cfg.term, "vt220");
}