diff --git a/src/layout.c b/src/layout.c index 4917c24f9..a829ccc9b 100644 --- a/src/layout.c +++ b/src/layout.c @@ -722,7 +722,7 @@ change_screen_size (void) * more than one curses implementation does this); it is guaranteed to work * only with slang. */ - init_curses (); + tty_init_curses (); #endif setup_panels (); diff --git a/src/main.c b/src/main.c index 759c4c194..37b120dea 100644 --- a/src/main.c +++ b/src/main.c @@ -2291,7 +2291,7 @@ main (int argc, char *argv[]) handle_args (argc, argv); - /* NOTE: This has to be called before init_slang or whatever routine + /* NOTE: This has to be called before tty_init_slang or whatever routine calls any define_sequence */ init_key (); @@ -2315,19 +2315,11 @@ main (int argc, char *argv[]) /* Must be done before init_subshell, to set up the terminal size: */ /* FIXME: Should be removed and LINES and COLS computed on subshell */ -#ifdef HAVE_SLANG - init_slang (); -#endif - - start_interrupt_key (); - - /* NOTE: This call has to be after slang_init. It's the small part from - the previous init_key which had to be moved after the call of slang_init */ - init_key_input_fd (); + tty_init_slang (); load_setup (); - init_curses (); + tty_init_curses (); tty_init_colors (); @@ -2346,7 +2338,6 @@ main (int argc, char *argv[]) init_xterm_support (); #ifdef HAVE_SUBSHELL_SUPPORT - /* Done here to ensure that the subshell doesn't */ /* inherit the file descriptors opened below, etc */ if (use_subshell) diff --git a/src/tty/tty-ncurses.c b/src/tty/tty-ncurses.c index 8a13023e6..3b4476d40 100644 --- a/src/tty/tty-ncurses.c +++ b/src/tty/tty-ncurses.c @@ -61,7 +61,7 @@ static const struct { /*** public functions **************************************************/ void -init_curses (void) +tty_init_curses (void) { initscr (); @@ -91,6 +91,11 @@ init_curses (void) } } +void +tty_init_slang (void) +{ +} + void tty_shutdown (void) { diff --git a/src/tty/tty-slang.c b/src/tty/tty-slang.c index d2a7037c1..d964571b9 100644 --- a/src/tty/tty-slang.c +++ b/src/tty/tty-slang.c @@ -217,7 +217,7 @@ load_terminfo_keys (void) /*** public functions **************************************************/ void -init_curses (void) +tty_init_curses (void) { SLsmg_init_smg (); do_enter_ca_mode (); @@ -226,7 +226,7 @@ init_curses (void) } void -init_slang (void) +tty_init_slang (void) { SLtt_get_terminfo (); #if SLANG_VERSION >= 20000 @@ -275,6 +275,9 @@ init_slang (void) tty_reset_prog_mode (); load_terminfo_keys (); SLtt_Blink_Mode = 0; + + /* It's the small part from the previous init_key() */ + init_key_input_fd (); } void diff --git a/src/tty/tty-slang.h b/src/tty/tty-slang.h index 49d65ceb1..109208923 100644 --- a/src/tty/tty-slang.h +++ b/src/tty/tty-slang.h @@ -26,8 +26,6 @@ enum { #define ACS_URCORNER SLSMG_URCORN_CHAR #define ACS_LRCORNER SLSMG_LRCORN_CHAR -void init_slang (void); -void init_curses (void); int getch (void); #define printw SLsmg_printf diff --git a/src/tty/tty.h b/src/tty/tty.h index 13e6a1d14..7646df1be 100644 --- a/src/tty/tty.h +++ b/src/tty/tty.h @@ -21,6 +21,10 @@ /* {{{ Input }}} */ +extern void tty_init_slang (void); +extern void tty_init_curses (void); +extern void tty_shutdown (void); + extern void tty_start_interrupt_key(void); extern void tty_enable_interrupt_key(void); extern void tty_disable_interrupt_key(void); @@ -39,8 +43,6 @@ extern void tty_keypad (gboolean set); extern void tty_nodelay (gboolean set); extern int tty_baudrate (void); -extern void tty_shutdown (void); - /* {{{ Output }}} */ /*