diff options
author | Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> | 2021-02-18 18:01:28 +0900 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-02-19 17:56:08 +0100 |
commit | 48285aa36c2c70115e17dacafd83c90e23e8f575 (patch) | |
tree | 914353058063875d166a34002c98485c486c28a3 /winsup/cygwin/spawn.cc | |
parent | 2b9219b4a54e897d6a5ae6815d75ffec4de1f785 (diff) | |
download | newlib-48285aa36c2c70115e17dacafd83c90e23e8f575.zip newlib-48285aa36c2c70115e17dacafd83c90e23e8f575.tar.gz newlib-48285aa36c2c70115e17dacafd83c90e23e8f575.tar.bz2 |
Cygwin: console: Fix handling of Ctrl-S in Win7.
- If ENABLE_LINE_INPUT is set, Ctrl-S is handled by Windows if the
OS is Windows 7. This conflicts with Ctrl-S handling in cygwin
console code. This patch unsets ENABLE_LINE_INPUT flag in cygwin
and set it when native app is executed.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4d4d599..323630f 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -607,6 +607,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, fhandler_pty_slave *ptys_primary = NULL; fhandler_console *cons_native = NULL; + termios *cons_ti = NULL; for (int i = 0; i < 3; i ++) { const int chk_order[] = {1, 0, 2}; @@ -621,16 +622,19 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, else if (fh && fh->get_major () == DEV_CONS_MAJOR) { fhandler_console *cons = (fhandler_console *) fh; - if (wincap.has_con_24bit_colors () && !iscygwin ()) + if (!iscygwin ()) { if (cons_native == NULL) - cons_native = cons; + { + cons_native = cons; + cons_ti = &((tty *)cons->tc ())->ti; + } if (fd == 0) - fhandler_console::request_xterm_mode_input (false, - cons->get_handle_set ()); + fhandler_console::set_input_mode (tty::native, + cons_ti, cons->get_handle_set ()); else if (fd == 1 || fd == 2) - fhandler_console::request_xterm_mode_output (false, - cons->get_handle_set ()); + fhandler_console::set_output_mode (tty::native, + cons_ti, cons->get_handle_set ()); } } } @@ -996,10 +1000,10 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, } if (cons_native) { - fhandler_console::request_xterm_mode_output (true, - &cons_handle_set); - fhandler_console::request_xterm_mode_input (true, - &cons_handle_set); + fhandler_console::set_output_mode (tty::cygwin, cons_ti, + &cons_handle_set); + fhandler_console::set_input_mode (tty::cygwin, cons_ti, + &cons_handle_set); fhandler_console::close_handle_set (&cons_handle_set); } myself.exit (EXITCODE_NOSET); @@ -1031,10 +1035,10 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, } if (cons_native) { - fhandler_console::request_xterm_mode_output (true, - &cons_handle_set); - fhandler_console::request_xterm_mode_input (true, - &cons_handle_set); + fhandler_console::set_output_mode (tty::cygwin, cons_ti, + &cons_handle_set); + fhandler_console::set_input_mode (tty::cygwin, cons_ti, + &cons_handle_set); fhandler_console::close_handle_set (&cons_handle_set); } break; |