joyent/node — Issue #2744: repl throws away buffered stdin data
Author: laverdet
Created: 2012-02-13 03:33:38+00:00
State: open

If you load up the repl with commands in your copy/paste buffer (or if you start typing before node is initialized) the repl will throw away those keystrokes. To repro copy this, and paste into a terminal:

```
node
console.log(1);
console.log(2);
```

When node starts up, the console.log() commands will have been lost.

I tried to take a stab at fixing this but I don't think there's a clean way to fix it without hairy libuv changes. You can get it working with setTimeout() but that's unstable and will fail with long lines of input.