diff options
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index f7c6dd590..772fe6dd6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -615,22 +615,13 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, { attach_to_console = true; if (wincap.has_con_24bit_colors () && !iscygwin ()) - { - DWORD dwMode; - if (fd == 0) - { - /* Disable xterm compatible mode in input */ - GetConsoleMode (fh->get_handle (), &dwMode); - dwMode &= ~ENABLE_VIRTUAL_TERMINAL_INPUT; - SetConsoleMode (fh->get_handle (), dwMode); - } - else - { - GetConsoleMode (fh->get_output_handle (), &dwMode); - dwMode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; - SetConsoleMode (fh->get_output_handle (), dwMode); - } - } + if (fd == 1 || fd == 2) + { + DWORD dwMode; + GetConsoleMode (fh->get_output_handle (), &dwMode); + dwMode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; + SetConsoleMode (fh->get_output_handle (), dwMode); + } } } |