public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Change the timing of clearing screen.
@ 2019-09-15 15:32 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-09-15 15:32 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d

commit 244f03627d37ea5ba642fc9a4b7c7b4a1a7be11d
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Sun Sep 15 13:05:53 2019 +0900

    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.

Diff:
---
 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 3bf8d0b..5c27510 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 ();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-15 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-15 15:32 [newlib-cygwin] Cygwin: pty: Change the timing of clearing screen Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).