Ejemplo n.º 1
0
void owl_select_handle_intr()
{
  owl_input in;

  owl_global_unset_interrupted(&g);
  owl_function_unmask_sigint(NULL);

  in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
  owl_process_input_char(in);
}
Ejemplo n.º 2
0
static void sig_handler_main_thread(void *data) {
  int sig = GPOINTER_TO_INT(data);

  owl_function_debugmsg("Got signal %d", sig);
  if (sig == SIGWINCH) {
    owl_function_resize();
  } else if (sig == SIGTERM || sig == SIGHUP) {
    owl_function_quit();
  } else if (sig == SIGINT && owl_global_take_interrupt(&g)) {
    owl_input in;
    in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
    owl_process_input_char(in);
  }
}
Ejemplo n.º 3
0
void owl_start_curses(void) {
  struct termios tio;
  /* save initial terminal settings */
  tcgetattr(STDIN_FILENO, owl_global_get_startup_tio(&g));

  tcgetattr(STDIN_FILENO, &tio);
  tio.c_iflag &= ~(ISTRIP|IEXTEN);
  tio.c_cc[VQUIT] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
  tio.c_cc[VSUSP] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
  tio.c_cc[VSTART] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
  tio.c_cc[VSTOP] = fpathconf(STDIN_FILENO, _PC_VDISABLE);
  tcsetattr(STDIN_FILENO, TCSAFLUSH, &tio);

  /* screen init */
  initscr();
  cbreak();
  noecho();

  owl_start_color();
}
Ejemplo n.º 4
0
void owl_shutdown_curses(void) {
  endwin();
  /* restore terminal settings */
  tcsetattr(STDIN_FILENO, TCSAFLUSH, owl_global_get_startup_tio(&g));
}