public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: console: Fix behaviour of "ESC 8" after reset.
Date: Mon,  9 Mar 2020 08:59:10 +0000 (GMT)	[thread overview]
Message-ID: <20200309085910.1AF453940CE1@server2.sourceware.org> (raw)

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

commit 3e7fff6b49fbdc1ab5022b145268622d8e5dedd3
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Mon Mar 9 10:38:36 2020 +0900

    Cygwin: console: Fix behaviour of "ESC 8" after reset.
    
    - This patch matches the behaviour of "ESC 8" (DECRC) to the real
      xterm after full reset (RIS), soft reset (DECSTR) and "CSI 3 J".

Diff:
---
 winsup/cygwin/fhandler_console.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 2c0b31c..3930c60 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2124,6 +2124,11 @@ fhandler_console::char_command (char c)
 	  break;
 	case 'J': /* ED */
 	  wpbuf.put (c);
+	  if (con.args[0] == 3 && con.savey >= 0)
+	    {
+	      con.fillin (get_output_handle ());
+	      con.savey -= con.b.srWindow.Top;
+	    }
 	  if (con.args[0] == 3 && wincap.has_con_broken_csi3j ())
 	    { /* Workaround for broken CSI3J in Win10 1809 */
 	      CONSOLE_SCREEN_BUFFER_INFO sbi;
@@ -2168,6 +2173,7 @@ fhandler_console::char_command (char c)
 	    {
 	      con.scroll_region.Top = 0;
 	      con.scroll_region.Bottom = -1;
+	      con.savex = con.savey = -1;
 	    }
 	  wpbuf.put (c);
 	  /* Just send the sequence */
@@ -3070,6 +3076,7 @@ fhandler_console::write (const void *vsrc, size_t len)
 		{
 		  con.scroll_region.Top = 0;
 		  con.scroll_region.Bottom = -1;
+		  con.savex = con.savey = -1;
 		}
 	      /* ESC sequences below (e.g. OSC, etc) are left to xterm
 		 emulation in xterm compatible mode, therefore, are not


                 reply	other threads:[~2020-03-09  8:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200309085910.1AF453940CE1@server2.sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).