From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107974 invoked by alias); 13 Jan 2020 11:36:10 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 107964 invoked by uid 89); 13 Jan 2020 11:36:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:ad285b6, Versioning, UD:1.x, UD:3.1.x X-HELO: ste-pvt-msa1.bahnhof.se Received: from ste-pvt-msa1.bahnhof.se (HELO ste-pvt-msa1.bahnhof.se) (213.80.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Jan 2020 11:36:05 +0000 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id BE4313F7F2 for ; Mon, 13 Jan 2020 12:36:02 +0100 (CET) X-Spam-Score: -1.9 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 XUBOw_tOFqPc for ; Mon, 13 Jan 2020 12:36:02 +0100 (CET) Received: from [10.10.69.123] (unknown [81.170.238.26]) (Authenticated sender: mb748077) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 1CE2A3F719 for ; Mon, 13 Jan 2020 12:36:02 +0100 (CET) Subject: Re: stty -cooked not usable since cygwin-3.1.1-1 To: cygwin@cygwin.com References: <20200113200152.5243a304d481677c61c12450@nifty.ne.jp> From: Rabbe Fogelholm Message-ID: <12d7cb6e-b900-6780-1d1c-80ed84cc82d5@bahnhof.se> Date: Mon, 13 Jan 2020 11:36:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.5 MIME-Version: 1.0 In-Reply-To: <20200113200152.5243a304d481677c61c12450@nifty.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00122.txt.bz2 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. --Rabbe -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple