Support for Pause Command
Currently the command prompt times out if the "pause" command is used. Add support for keyboard interruption of the "pause" command.
The “pause” function now accepts keyboard input to break the pause. The related function “kbhit” was fixed in the process.
-
Hi Victor,
You're correct that my implementation of "pause" is not exactly identical to the desktop version of Octave. If you stick to only pressing "Enter" and not any other characters, then "pause" should work as intended.
I am not able to reproduce the second behavior you mentioned. If I run the following command, I have to press Enter 10 times before I regain control of the console.
for ii=1:10; disp(ii); pause(); end
I wonder if this might have to do with your operating system? Not sure.
-Shane
-
Victor commented
Hi Shane,
I think it does not work as should though. It waits to press something, AND press `enter`: if just press something, without `enter` after it, it does nothing. While octave help says:
"If invoked without an input arguments then the program is suspended until a character is typed."Next, Oct.-Online considers 2 keyboard presses took place, and therefore runs. If in the run it encounters another `pause()`, it does not wait, because it considers 2 presses happened. Not sure this is how it should be, as I can't test on a stand-alone Octave.
Please check with following:
```
for ii=1:10
pause()
end
``` -
Victorel Petrovich commented
Thanks for fixing it fast Shane, you offer great user support!
-
Victorel Petrovich commented
Hmm, I was thinking that just by fixing "input" function, this "pause" would work as well. So it must be more complicated than that I guess.