Cygwin: pty: Change the timing of clearing screen.

- The code which clears screen is moved from reset_switch_to_pcon()
  to fixup_after_exec() because it seems not too early even at this
  timing.
This commit is contained in:
Takashi Yano 2019-09-15 13:05:53 +09:00 committed by Ken Brown
parent d83c45b46c
commit 244f03627d
1 changed files with 13 additions and 13 deletions

View File

@ -1041,19 +1041,6 @@ skip_console_setting:
void void
fhandler_pty_slave::reset_switch_to_pcon (void) fhandler_pty_slave::reset_switch_to_pcon (void)
{ {
if (get_ttyp ()->need_clear_screen)
{
const char *term = getenv ("TERM");
if (term && strcmp (term, "dumb") && !strstr (term, "emacs"))
{
/* FIXME: Clearing sequence may not be "^[[H^[[J"
depending on the terminal type. */
DWORD n;
WriteFile (get_output_handle_cyg (), "\033[H\033[J", 6, &n, NULL);
}
get_ttyp ()->need_clear_screen = false;
}
if (isHybrid) if (isHybrid)
this->set_switch_to_pcon (fd); this->set_switch_to_pcon (fd);
if (get_ttyp ()->pcon_pid && if (get_ttyp ()->pcon_pid &&
@ -2742,6 +2729,19 @@ fhandler_pty_slave::fixup_after_exec ()
} }
} }
if (get_ttyp ()->need_clear_screen)
{
const char *term = getenv ("TERM");
if (term && strcmp (term, "dumb") && !strstr (term, "emacs"))
{
/* FIXME: Clearing sequence may not be "^[[H^[[J"
depending on the terminal type. */
DWORD n;
WriteFile (get_output_handle_cyg (), "\033[H\033[J", 6, &n, NULL);
}
get_ttyp ()->need_clear_screen = false;
}
/* Set locale */ /* Set locale */
setup_locale (); setup_locale ();