From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: wait does not perform as expected Date: Thu, 23 Feb 2023 21:31:52 +0200 Organization: Tidorum Ltd Message-ID: References: <75c3990e-eaab-47eb-bdba-3827b9fd4751n@googlegroups.com> <72723295-3b36-412f-a5fc-f1dd2f5a56edn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net E23soGxdzkzghZNmtXvtYwyvVyUSWPbXqf2TF7EDczvv7xHu1G Cancel-Lock: sha1:/McHiXALuFl1wmsz+6LpZaDfoJA= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US In-Reply-To: <72723295-3b36-412f-a5fc-f1dd2f5a56edn@googlegroups.com> Xref: reader01.eternal-september.org comp.lang.ada:64976 List-Id: On 2023-02-23 20:47, Daniel Gaudry wrote: > Hi, > On my ubuntu system the > ada.text_io.GET_IMMEDIATE(ITEM => CHAR, AVAILABLE => HIT); > just pause the program regardless of any key being hit. Hmm... it occurred to me to try to execute the program under GPS, not in a shell window. If I run a Get_Immediate loop under GPS, within the input-output window of GPS, there is /no reaction/ to keystrokes until I press Return/Enter. Get_Immediate returns Available => False until Return/Enter is pressed, after which it returns the characters typed before Return/Enter, one by one in order. So it seems that, on my system, Get_Immediate cannot disable the line-buffering of the standard-input "terminal", but must wait for Return/Enter until it sees any input. And line-editing too is still active under Get_Immediate, when running within GPS. I am starting to suspect that the behaviour I see in my shell command window may be due partly to the terminal emulator that implements such windows on my system (MacOS "Terminal" app). Daniel, how are you compiling and running your code? Under GPS, in a shell window, or in some other way (shell script)? If you have been running within GPS, try to run your program in a normal shell command window.