aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2021-01-19 18:27:02 +0900
committerCorinna Vinschen <corinna@vinschen.de>2021-01-19 10:56:43 +0100
commit62e739b51bb1cbe644470c40ca414d8a2ea34c18 (patch)
tree1d094fd4efd68d8645da7be108abf01dbe27f5bc
parent59ccb3a00815cef8e4dd7b4b7b99980862de0476 (diff)
downloadnewlib-62e739b51bb1cbe644470c40ca414d8a2ea34c18.zip
newlib-62e739b51bb1cbe644470c40ca414d8a2ea34c18.tar.gz
newlib-62e739b51bb1cbe644470c40ca414d8a2ea34c18.tar.bz2
Cygwin: pty: Lessen the side effect of workaround for rlwarp.
- This patch lessens the side effect of the workaround for rlwrap introduced by commit 4e16b033.
-rw-r--r--winsup/cygwin/fhandler_tty.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 473c0c9..c78e996 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1176,11 +1176,19 @@ fhandler_pty_slave::tcgetattr (struct termios *t)
{
reset_switch_to_pcon ();
*t = get_ttyp ()->ti;
+
/* Workaround for rlwrap */
- if (get_ttyp ()->pcon_start)
- t->c_lflag &= ~(ICANON | ECHO);
- if (get_ttyp ()->h_pseudo_console)
- t->c_iflag &= ~ICRNL;
+ cygheap_fdenum cfd (false);
+ while (cfd.next () >= 0)
+ if (cfd->get_major () == DEV_PTYM_MAJOR
+ && cfd->get_minor () == get_minor ())
+ {
+ if (get_ttyp ()->pcon_start)
+ t->c_lflag &= ~(ICANON | ECHO);
+ if (get_ttyp ()->h_pseudo_console)
+ t->c_iflag &= ~ICRNL;
+ break;
+ }
return 0;
}