From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by server2.sourceware.org (Postfix, from userid 2155) id 1AF453940CE1; Mon, 9 Mar 2020 08:59:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 server2.sourceware.org 1AF453940CE1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1583744350; bh=x9rDvMwzRGotOBODqg+DRvgFnDIMdmBLbI06c8IKfbA=; h=From:To:Subject:Date:From; b=JMpx/ZqNTSfkzRGiLNPU65EEV+0RY0rCwellob44gkuHDn7UGGrAKR1vQtMyde5yF sexRxfnouQfrdN3/P9QK+13BPiw8MKE9OSc/GrsMbg4W3/bMB1F82tnI5v6zxmQAAI 7MOHUOLgq+5kDphZURVKQitm8AaM4ZJLqcNklKYE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: console: Fix behaviour of "ESC 8" after reset. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: bf0cb64d905d23b1f9241d3e789a06427514cacb X-Git-Newrev: 3e7fff6b49fbdc1ab5022b145268622d8e5dedd3 Message-Id: <20200309085910.1AF453940CE1@server2.sourceware.org> Date: Mon, 9 Mar 2020 08:59:10 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 08:59:10 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3e7fff6b49fbdc1ab5022b145268622d8e5dedd3 commit 3e7fff6b49fbdc1ab5022b145268622d8e5dedd3 Author: Takashi Yano 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