void tty_change_screen_size (void) { #if defined(TIOCGWINSZ) && NCURSES_VERSION_MAJOR >= 4 struct winsize winsz; winsz.ws_col = winsz.ws_row = 0; #ifndef NCURSES_VERSION tty_noraw_mode (); tty_reset_screen (); #endif /* Ioctl on the STDIN_FILENO */ ioctl (fileno (stdout), TIOCGWINSZ, &winsz); if (winsz.ws_col != 0 && winsz.ws_row != 0) { #if defined(NCURSES_VERSION) && defined(HAVE_RESIZETERM) resizeterm (winsz.ws_row, winsz.ws_col); clearok (stdscr, TRUE); /* sigwinch's should use a semaphore! */ #else COLS = winsz.ws_col; LINES = winsz.ws_row; #endif } #endif /* defined(TIOCGWINSZ) || NCURSES_VERSION_MAJOR >= 4 */ #ifdef ENABLE_SUBSHELL if (mc_global.tty.use_subshell) tty_resize (mc_global.tty.subshell_pty); #endif }
void tty_shutdown (void) { tty_reset_shell_mode (); tty_noraw_mode (); tty_keypad (FALSE); tty_reset_screen (); tty_exit_ca_mode (); }
void tty_shutdown (void) { disable_mouse (); tty_reset_shell_mode (); tty_noraw_mode (); tty_keypad (FALSE); tty_reset_screen (); do_exit_ca_mode (); }
void tty_shutdown (void) { char *op_cap; disable_mouse (); tty_reset_shell_mode (); tty_noraw_mode (); tty_keypad (FALSE); tty_reset_screen (); do_exit_ca_mode (); SLang_reset_tty (); /* Load the op capability to reset the colors to those that were * active when the program was started up */ op_cap = SLtt_tgetstr ((char *) "op"); if (op_cap != NULL) { fputs (op_cap, stdout); fflush (stdout); } }
void dialog_change_screen_size (void) { mc_global.tty.winch_flag = FALSE; #if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 #if defined TIOCGWINSZ #ifndef NCURSES_VERSION tty_noraw_mode (); tty_reset_screen (); #endif tty_change_screen_size (); #ifdef HAVE_SLANG /* XSI Curses spec states that portable applications shall not invoke * initscr() more than once. This kludge could be done within the scope * of the specification by using endwin followed by a refresh (in fact, * more than one curses implementation does this); it is guaranteed to work * only with slang. */ SLsmg_init_smg (); do_enter_ca_mode (); tty_keypad (TRUE); tty_nodelay (FALSE); #endif /* Inform all suspending dialogs */ dialog_switch_got_winch (); /* Inform all running dialogs */ g_list_foreach (top_dlg, (GFunc) dlg_resize_cb, NULL); /* Now, force the redraw */ repaint_screen (); #endif /* TIOCGWINSZ */ #endif /* defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 */ }