From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 039573844011; Wed, 16 Dec 2020 09:39:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 039573844011 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: Revise the 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: da8cebcdedb07ea1029009c19f6c2dc23216e4dd X-Git-Newrev: 4e16b0330a04f7f6503957a9aed344cb716605f9 Message-Id: <20201216093926.039573844011@sourceware.org> Date: Wed, 16 Dec 2020 09:39:26 +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: Wed, 16 Dec 2020 09:39:26 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4e16b0330a04f7f6503957a9aed344cb716605f9 commit 4e16b0330a04f7f6503957a9aed344cb716605f9 Author: Takashi Yano via Cygwin-patches Date: Wed Dec 16 18:10:58 2020 +0900 Cygwin: pty: Revise the workaround for rlwrap. - Previous workaround has a problem that screen is distorted if up arrow key is pressed at the first line after running "rlwrap cmd". This patch fixes the issue. Diff: --- winsup/cygwin/fhandler_tty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 77d9d9b47..77f7bfe43 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -1111,8 +1111,8 @@ fhandler_pty_slave::tcgetattr (struct termios *t) *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_lflag &= ~(ICANON | ECHO); + if (get_ttyp ()->h_pseudo_console) t->c_iflag &= ~ICRNL; return 0; }