From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by sourceware.org (Postfix) with ESMTPS id D7DD6387084D for ; Tue, 28 Jul 2020 13:56:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D7DD6387084D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bahnhof.se Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rabbe@bahnhof.se Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id C0ED63F447 for ; Tue, 28 Jul 2020 15:56:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.724 X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ms_5uep4UMhz for ; Tue, 28 Jul 2020 15:56:56 +0200 (CEST) Received: from [10.0.0.9] (h-47-10.A165.priv.bahnhof.se [46.59.47.10]) (Authenticated sender: mb748077) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 3F5303F27D for ; Tue, 28 Jul 2020 15:56:56 +0200 (CEST) Subject: Re: stty -cooked not usable since cygwin-3.1.1-1 To: cygwin@cygwin.com References: <20200113200152.5243a304d481677c61c12450@nifty.ne.jp> <12d7cb6e-b900-6780-1d1c-80ed84cc82d5@bahnhof.se> From: Rabbe Fogelholm Message-ID: <1ea4e90c-7075-39e8-a518-40bc764a5237@bahnhof.se> Date: Tue, 28 Jul 2020 15:56:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2 MIME-Version: 1.0 In-Reply-To: <12d7cb6e-b900-6780-1d1c-80ed84cc82d5@bahnhof.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 13:56:59 -0000 Rabbe Fogelholm wrote: > Takashi Yano wrote: >> On Mon, 13 Jan 2020 11:52:43 +0100 >> Rabbe Fogelholm wrote: >>> I am running a console Java program that is started from a shellscript >>> wrapper. Before invoking Java the wrapper calls `stty -cooked'. The Java >>> program polls the keyboard using System.in.available() and reads >>> characters immediately using System.in.read(), without waiting for the >>> Enter key to be pressed. >>> >>> This way of combining `stty -cooked' and Java has stopped working since >>> version 3.1.1-1 of the Cygwin package. The Java thread that reads the >>> keyboard hangs until Enter is pressed, which is not desirable. >>> >>> I had to downgrade to version 3.0.7-1 to resolve the problem. >>> >>> Versioning information: >>> >>> java version "1.8.0_202" >>> Java(TM) SE Runtime Environment (build 1.8.0_202-b08) >>> Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode) >>> >>> OS Name: Microsoft Windows 10 Pro >>> Version: 10.0.17763 Build 17763 >>> System Type: x64-based PC >>> >>> See also the enclosed cygcheck.out. >>> >>> To demonstrate the issue I enclose a small Java program that should be >>> able to read single keystrokes when `stty -cooked' is in effect. >> >> Does your java program work in command prompt? cygwin 3.1.x uses >> pseudo console, so the native (non cygwin) program works as if it >> is executed in command prompt. >> > > With cygwin 3.1.x I can't find a way to make my program work. > > When running from within a Cygwin64 terminal the `stty -cooked' command > terminates with exit code 0, but the Java program behaves just as if > `stty -cooked' is not in effect: It does not handle single keystrokes > immediately. > > When running from a Windows command prompt I can execute the stty > program as \cygwin64\bin\stty. However, when given the '-cooked' > argument it complains: > /usr/bin/stty: 'standard input': unable to perform all requested operations > > - and here as well the Java program behaves as if `stty -cooked' is not > in effect. Some time has passed; I am just curious if anyone may have found a solution to the "stty -cooked" issue. With cygwin-3.0.* it was possible to have a Java program act on single keystrokes, with cygwin-3.1 I don't know how to do it. Any ideas welcome!