summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2019-09-15 13:05:53 +0900
committerKen Brown <kbrown@cornell.edu>2019-09-15 11:09:06 -0400
commit244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d (patch)
tree47126eb02a3c16ff1e065ba8480c6c25a691f75e
parentd83c45b46cdff9e550bac50ca382392c838b4e68 (diff)
downloadcygnal-244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d.tar.gz
cygnal-244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d.tar.bz2
cygnal-244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d.zip
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.
-rw-r--r--winsup/cygwin/fhandler_tty.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 3bf8d0b75..5c27510be 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1041,19 +1041,6 @@ skip_console_setting:
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)
this->set_switch_to_pcon (fd);
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 */
setup_locale ();