From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 636733858004; Mon, 14 Dec 2020 10:02:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 636733858004 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Add a workaround for rlwrap. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: 55eff668b878fe6571cd363a4ce80dd0b1d718da X-Git-Newrev: 8199b0cc38de3553d2e86f170d7da0b64405d10c Message-Id: <20201214100255.636733858004@sourceware.org> Date: Mon, 14 Dec 2020 10:02:55 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2020 10:02:55 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8199b0cc38de3553d2e86f170d7da0b64405d10c commit 8199b0cc38de3553d2e86f170d7da0b64405d10c Author: Takashi Yano via Cygwin-patches Date: Mon Dec 14 17:26:47 2020 +0900 Cygwin: pty: Add a workaround for rlwrap. - If rlwrap is used with non-cygwin apps, it fails to setup pseudo console. This patch adds a workaround for this issue. Diff: --- winsup/cygwin/fhandler_tty.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 04a9a2bf5..5f38ca8d3 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -1109,6 +1109,11 @@ 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; + else if (get_ttyp ()->h_pseudo_console) + t->c_iflag &= ~ICRNL; return 0; }