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:
authorCorinna Vinschen <corinna@vinschen.de>2008-06-12 19:57:35 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-06-12 19:57:35 +0400
commitcdab7783c40f97e482161a3943a750a5feb00aea (patch)
tree70f4d880a4fad5e106d6277be46acde47e717e87
parent2ed056f092f7fea88a8f1bb807b9a3e13f4d37e2 (diff)
* fhandler_console.cc (fhandler_console::open): Set console state last.cr-0x5f1
Only add ENABLE_PROCESSED_INPUT flag if this is the first time we open the console.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_console.cc13
2 files changed, 14 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b67e0eea8..40d3e2607 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_console.cc (fhandler_console::open): Set console state last.
+ Only add ENABLE_PROCESSED_INPUT flag if this is the first time we open
+ the console.
+
2008-04-17 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Fix pipe related test.
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 82ede58cd..2b51ceeb0 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -682,16 +682,19 @@ fhandler_console::open (int flags, mode_t)
dev_state->set_default_attr ();
}
+ tc->rstcons (false);
+ set_open_status ();
+ int cons_cnt = cygheap->manage_console_count ("fhandler_console::open", 1);
+
DWORD cflags;
if (GetConsoleMode (get_io_handle (), &cflags))
{
- cflags |= ENABLE_PROCESSED_INPUT;
- SetConsoleMode (get_io_handle (), ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags);
+ if (cons_cnt <= 1)
+ cflags |= ENABLE_PROCESSED_INPUT;
+ SetConsoleMode (get_io_handle (),
+ ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags);
}
- tc->rstcons (false);
- set_open_status ();
- cygheap->manage_console_count ("fhandler_console::open", 1);
debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (),
get_output_handle ());