octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55029] pause() with no arguments does not ret


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #55029] pause() with no arguments does not return like kbhit() with glibc 2.28
Date: Thu, 28 Mar 2019 17:48:23 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Follow-up Comment #56, bug #55029 (project octave):

I have setup a virtual box with Fedora 29 (this took me hours) and couldn't
find anything to make kbhit work as expected (this took me hours also :-)). 

As Mike has shown, "kbhit (0)" works once and then returns immediately
afterwards. The first times, std::cin.get() manages to retrieve a charater but
std::cin's error flags (fail and eof) are set. Even after clearing those flags
and doing a seekg(0), we can never get the terminal to returns into actual
raw_mode and std::cin.get() always returns -1.

This is strange: why should the failbit be set when the read succeeded?

Also when using a timeout (VTIME > 0 and VMIN = 0) the observed behavior with
glibc 2.28 does not match termios doc:

>> ... read(2) returns either when at least one byte of data is available, or
when the timer expires. [1]

I setup a 2s timeout (using the patch from comment #49) and saw that the first
call to "pause ()", when it seemingly works, does not exactly do that:
std::cin.get() returns the character after the timeout, even though the
character has been typed well before.

I am lost.

[1] http://man7.org/linux/man-pages/man3/termios.3.html

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55029>

_______________________________________________
  Message posté via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]