Skip to content
Snippets Groups Projects
Commit f57634f0 authored by deuce's avatar deuce
Browse files

Use raw_read()/raw_write() and go back to using socket_select() on !Win32.

No longer blocks for an extra keypress at termination on *nix.  Something
like raw_poll or something will be needed to let Win32 work (and to avoid
the silly socket_select(file) usage).
parent ceddc46e
No related branches found
No related tags found
No related merge requests found
load("ansi_console.js");
dk.console.remote_io.print = function(string) {
stdout.write(string);
stdout.flush();
stdout.raw_write(string);
};
var jsexec_input_queue = load(true, "jsexec_input.js");
......
......@@ -7,6 +7,13 @@ var k;
while(!js.terminated) {
if (parent_queue.poll(0))
break;
k = stdin.read(1);
if (system.platform == 'Win32')
k = stdin.raw_read(1);
else {
if (socket_select([stdin.descriptor], 0.1).length == 1)
k = stdin.raw_read(1);
else
k = undefined;
}
ai.add(k);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment