- If two cygwin programs are executed simultaneousley with pipes
in cmd.exe, xterm compatible mode is accidentally disabled by
the process which ends first. After that, escape sequences are
not handled correctly in the other app. This is the problem 2
reported in https://cygwin.com/ml/cygwin/2020-02/msg00116.html.
This patch fixes the issue. This patch also fixes the problem 3.
For these issues, the timing of setting and unsetting xterm
compatible mode is changed. For read, xterm compatible mode is
enabled only within read() or select() functions. For write, it
is enabled every time write() is called, and restored on close().
winsup/cygwin/fhandler_console.cc | 101 +++++++++++++++---------------
winsup/cygwin/select.cc | 32 +++++++++-
winsup/cygwin/spawn.cc | 23 +++----
3 files changed, 89 insertions(+), 67 deletions(-)