From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 378BB3857C72; Sun, 12 Dec 2021 13:09:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 378BB3857C72 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: pty: Fix console mode of non-cygwin apps in background. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/cygwin-3_3-branch X-Git-Oldrev: ab8608f88f5484e18757cd1ce78c7394b7d0a3c8 X-Git-Newrev: 5e23f2376efb6540b74b3e10297a128c9bd89b5f Message-Id: <20211212130938.378BB3857C72@sourceware.org> Date: Sun, 12 Dec 2021 13:09:38 +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: Sun, 12 Dec 2021 13:09:38 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5e23f2376efb6540b74b3e10297a128c9bd89b5f commit 5e23f2376efb6540b74b3e10297a128c9bd89b5f Author: Takashi Yano Date: Sun Dec 12 21:24:15 2021 +0900 Cygwin: pty: Fix console mode of non-cygwin apps in background. - If the non-cygwin app is started in the background in pseudo console, the console mode is broken for the app. This patch fixes the issue. Diff: --- winsup/cygwin/fhandler_tty.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 37e27f34a..7b18a15e7 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -3384,7 +3384,7 @@ skip_create: if (get_ttyp ()->previous_output_code_page) SetConsoleOutputCP (get_ttyp ()->previous_output_code_page); - do + if (get_ttyp ()->getpgid () == myself->pgid) { termios &t = get_ttyp ()->ti; DWORD mode; @@ -3409,7 +3409,6 @@ skip_create: mode |= DISABLE_NEWLINE_AUTO_RETURN; SetConsoleMode (hpConOut, mode); } - while (false); return true;