summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2019-08-12 22:48:45 +0900
committerCorinna Vinschen <corinna@vinschen.de>2019-08-12 17:08:48 +0200
commitd178de278a7a8c73f5c8c8b61def5e13e07ece2c (patch)
tree1cbf7ce3aa3b3242d53f20551f0a2f1feb401eed
parent33a21904a702191cebf0e81b4deba2dfa10a406c (diff)
downloadcygnal-d178de278a7a8c73f5c8c8b61def5e13e07ece2c.tar.gz
cygnal-d178de278a7a8c73f5c8c8b61def5e13e07ece2c.tar.bz2
cygnal-d178de278a7a8c73f5c8c8b61def5e13e07ece2c.zip
Cygwin: console: Fix cursor position restore after screen alternation.
- If screen is alternated on console, cursor position is not restored correctly in the case of xterm compatible mode is enabled. For example, the shell prompt is shown at incorrect position after using vim. This patch fixes this problem.
-rw-r--r--winsup/cygwin/fhandler_console.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index b46a4d513..4afb7efb7 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -308,6 +308,9 @@ void
fhandler_console::set_cursor_maybe ()
{
con.fillin (get_output_handle ());
+ /* Nothing to do for xterm compatible mode. */
+ if (wincap.has_con_24bit_colors ())
+ return;
if (con.dwLastCursorPosition.X != con.b.dwCursorPosition.X ||
con.dwLastCursorPosition.Y != con.b.dwCursorPosition.Y)
{