From 5de3a1c10f07e4d48b313b9b68d43563b21d4250 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 12 Oct 2011 14:19:20 +0000 Subject: [PATCH] * fhandler_console.cc (fhandler_console::cursor_set): Disable forcing y to the current winBottom position. Explain why. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_console.cc | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cb70e4adb..ad1989ae3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-10-12 Corinna Vinschen + + * fhandler_console.cc (fhandler_console::cursor_set): Disable forcing + y to the current winBottom position. Explain why. + 2011-10-11 Christopher Faylor * cygwin.din: Remove some _tc* exports. Add tcgetsid(). diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 9a8ddf8dc..c975fc479 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1175,9 +1175,19 @@ fhandler_console::cursor_set (bool rel_to_top, int x, int y) COORD pos; dev_state.fillin_info (get_output_handle ()); +#if 0 + /* Setting y to the current winBottom here is the reason that the window + isn't scrolled back to the current cursor position like it's done in + any other terminal. Rather, the curser is forced to the bottom of the + currently scrolled region. This breaks the console buffer content if + output is generated while the user had the window scrolled back. This + behaviour is very old, it has no matching ChangeLog entry. + Just disable for now but keep the code in for future reference. */ if (y > dev_state.info.winBottom) y = dev_state.info.winBottom; - else if (y < 0) + else +#endif + if (y < 0) y = 0; else if (rel_to_top) y += dev_state.info.winTop;