This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Cygwin: pty: Change the timing of clear screen.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin-patches at cygwin dot com
- Cc: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- Date: Wed, 16 Oct 2019 21:34:09 +0900
- Subject: [PATCH] Cygwin: pty: Change the timing of clear screen.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-02.nifty.com x9GCYLi2017325
- References: <20191016123409.457-1-takashi.yano@nifty.ne.jp>
---
winsup/cygwin/fhandler_tty.cc | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 1095c82eb..baf3c9794 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -2714,6 +2714,19 @@ fhandler_pty_slave::fixup_after_fork (HANDLE parent)
// fork_fixup (parent, inuse, "inuse");
// fhandler_pty_common::fixup_after_fork (parent);
report_tty_counts (this, "inherited", "");
+
+ 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;
+ }
}
void
@@ -2757,19 +2770,6 @@ 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 ();
--
2.21.0