Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2022-02-03 15:09:44 +0300
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-02-03 15:16:38 +0300
commitdf0a643c6a069d9f4175a5aacabeee7c8fd54bef (patch)
tree986c9309f1adcc49b7a500934e11354d606d9495
parent71d5490a3a2d769e1893f11c98edb06468ad6af4 (diff)
Cygwin: console: Fix IL/DL escape sequence on the last line.
- Currently, escape sequence IL/DL (CSI Ps L, CSI Ps M) does not work correctly at the last (bottom end) line. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-February/250736.html
-rw-r--r--winsup/cygwin/fhandler_console.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index da1d2e80f..65325adeb 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2174,6 +2174,12 @@ fhandler_console::char_command (char c)
cursor_get (&x, &y);
if (y < srTop || y > srBottom)
break;
+ if (y == con.b.srWindow.Bottom)
+ {
+ WriteConsoleW (get_output_handle (), L"\033[2K", 4, 0, 0);
+ wpbuf.empty ();
+ break;
+ }
if (y == con.b.srWindow.Top
&& srBottom == con.b.srWindow.Bottom)
{
@@ -2213,6 +2219,12 @@ fhandler_console::char_command (char c)
cursor_get (&x, &y);
if (y < srTop || y > srBottom)
break;
+ if (y == con.b.srWindow.Bottom)
+ {
+ WriteConsoleW (get_output_handle (), L"\033[2K", 4, 0, 0);
+ wpbuf.empty ();
+ break;
+ }
__small_swprintf (bufw, L"\033[%d;%dr",
y + 1 - con.b.srWindow.Top,
srBottom + 1 - con.b.srWindow.Top);