I'm trying to find a way to see if a user has typed anything into the REPL 
while a long-running computation takes place so that users can hit a special 
key to pause their computation and inspect its intermediate state.

To get started, I wrote this snippet and tried to see if it would count input 
that I typed into the REPL:

for i in 1:5
    sleep(1)
    println()
    println(nb_available(STDIN))
end

It doesn't seem like STDIN receives the keystrokes I type while this loop is 
executing.

How would one get access to those keystrokes in the current REPL? Should I be 
using some kind of interrupt handling instead?

 -- John

Reply via email to