This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Cygwin: pty: Change the timing of clear screen.
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Cc: Michael Haubenwallner <michael dot haubenwallner at ssi-schaefer dot com>
- Date: Thu, 17 Oct 2019 14:55:20 +0000
- Subject: Re: [PATCH] Cygwin: pty: Change the timing of clear screen.
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HjcD1vPQtPJgM5LtMk8Vqqt/MLALb69FzHS7LOKZQC0=; b=SWMQZtuEg6l4g0YV/oEFV0OUR6sz90ujsNBoK6tsawv9N4BNKhtt60poocBsYP/udxhOgpzrtpNmzlLZ4RTakQOI7UkQw6s0fn3nPVXwJ/OdIRuILnkL8vrpCbYg6CEeSABbk2vplxBj4sLW/grYAznbrUlTkW6wGRVIQYo0xhetfmMOWsv8eynst2szg7H2HAy+lGodcgEBOJx7T0Gj3xcbR0YWa5omxzB7b6LxNKnP7Z28Ua0H0fyVKpeSLE8B5BGFEs1pV01kR6U+iQWgR6M8ISpqDLXDrOpFFhNvcf+dMBT5Q+HePSBWCAhWx/xODQE4kS12+Ak7rvBOUCqdRg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iYUWspYmd9lyPdC/TgaT4TSzCOqXjebyalN5Wg8U0kj1VK20/ew4pOQ8Yu2uPozi0ePNJytMxi5C9LC20NAF5QmLiaNGTteaRs1paXPMZD9s4Tx67CXMDkJILxRS/OxOwydEvto8EnDvv67siC2Q4gYsk0/ldJON4D3wGIP+5260+b+tFuN1InM2Jp48datHVPa+g6Vk7Sd46QnLow301JE9e/njwJH+0UPY7QGu1Pn4uhTxNhnwSmd2cl1ukH5apbKxHkAGyuJqrbD+sWpQbw5rvnxbKfKm/YVQ5vljaoNCI0KbQIH9H64ivLNO8r1olcU2HMxvge1qVA7RL7wv8Q==
- References: <20191016123409.457-1-takashi.yano@nifty.ne.jp> <20191016123409.457-2-takashi.yano@nifty.ne.jp>
On 10/16/2019 8:34 AM, Takashi Yano wrote:
> ---
> 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 ();
This and the previous patch look good to me, but we should probably wait
for Haubi to confirm that they fix the problems he reported.
Ken