Merge branch '3639_subshell_output_lost_fix'

* 3639_subshell_output_lost_fix:
  Do not botch SIGWINCH delivery to the subshell.
  Ticket #3639: fix window resizing when panels are hidden.
This commit is contained in:
Andrew Borodin 2016-06-28 09:34:46 +03:00
commit 57d713085b
2 changed files with 9 additions and 2 deletions

View File

@ -83,6 +83,8 @@ static struct termios new_mode;
/* Controls whether we should wait for input in tty_lowlevel_getch */ /* Controls whether we should wait for input in tty_lowlevel_getch */
static gboolean no_slang_delay; static gboolean no_slang_delay;
static gboolean slsmg_active = FALSE;
/* This table describes which capabilities we want and which values we /* This table describes which capabilities we want and which values we
* assign to them. * assign to them.
*/ */
@ -329,6 +331,7 @@ tty_init (gboolean mouse_enable, gboolean is_xterm)
tty_display_8bit (FALSE); tty_display_8bit (FALSE);
SLsmg_init_smg (); SLsmg_init_smg ();
slsmg_active = TRUE;
if (!mouse_enable) if (!mouse_enable)
use_mouse_p = MOUSE_DISABLED; use_mouse_p = MOUSE_DISABLED;
tty_init_xterm_support (is_xterm); /* do it before tty_enter_ca_mode() call */ tty_init_xterm_support (is_xterm); /* do it before tty_enter_ca_mode() call */
@ -354,6 +357,7 @@ tty_shutdown (void)
tty_reset_screen (); tty_reset_screen ();
tty_exit_ca_mode (); tty_exit_ca_mode ();
SLang_reset_tty (); SLang_reset_tty ();
slsmg_active = FALSE;
/* Load the op capability to reset the colors to those that were /* Load the op capability to reset the colors to those that were
* active when the program was started up * active when the program was started up
@ -388,7 +392,8 @@ void
tty_change_screen_size (void) tty_change_screen_size (void)
{ {
SLtt_get_screen_size (); SLtt_get_screen_size ();
SLsmg_reinit_smg (); if (slsmg_active)
SLsmg_reinit_smg ();
#ifdef ENABLE_SUBSHELL #ifdef ENABLE_SUBSHELL
if (mc_global.tty.use_subshell) if (mc_global.tty.use_subshell)
@ -404,6 +409,7 @@ tty_reset_prog_mode (void)
{ {
tcsetattr (SLang_TT_Read_FD, TCSANOW, &new_mode); tcsetattr (SLang_TT_Read_FD, TCSANOW, &new_mode);
SLsmg_init_smg (); SLsmg_init_smg ();
slsmg_active = TRUE;
SLsmg_touch_lines (0, LINES); SLsmg_touch_lines (0, LINES);
} }
@ -504,6 +510,7 @@ int
tty_reset_screen (void) tty_reset_screen (void)
{ {
SLsmg_reset_smg (); SLsmg_reset_smg ();
slsmg_active = FALSE;
return 0; /* OK */ return 0; /* OK */
} }

View File

@ -531,7 +531,7 @@ feed_subshell (int how, gboolean fail_on_error)
/* Despite using SA_RESTART, we still have to check for this */ /* Despite using SA_RESTART, we still have to check for this */
if (errno == EINTR) if (errno == EINTR)
{ {
if (how == QUIETLY && mc_global.tty.winch_flag != 0) if (mc_global.tty.winch_flag != 0)
tty_change_screen_size (); tty_change_screen_size ();
continue; /* try all over again */ continue; /* try all over again */