From 01d4e87f57e10274785bd508b928dc2d686356d7 Mon Sep 17 00:00:00 2001 From: Lucas Stadler Date: Sun, 20 May 2012 11:28:58 +0200 Subject: [PATCH] fix repl completion and navigation The readline interface of node has changed in [aad12d0][] and because of that the autocompletion and key movement didn't work anymore. This commit fixes this by checking whether stdin is in raw mode (i.e. invoked as a script) or not (as a repl). [aad12d0]: https://github.com/joyent/node/commit/aad12d0 --- lib/coffee-script/repl.js | 2 +- src/repl.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee-script/repl.js b/lib/coffee-script/repl.js index 3d8b58c1..3c0a1f43 100644 --- a/lib/coffee-script/repl.js +++ b/lib/coffee-script/repl.js @@ -156,7 +156,7 @@ return repl.prompt(); }; - if (stdin.readable) { + if (stdin.readable && stdin.isRaw) { pipedInput = ''; repl = { prompt: function() { diff --git a/src/repl.coffee b/src/repl.coffee index f052511a..d94c63eb 100644 --- a/src/repl.coffee +++ b/src/repl.coffee @@ -115,7 +115,7 @@ run = (buffer) -> error err repl.prompt() -if stdin.readable +if stdin.readable and stdin.isRaw # handle piped input pipedInput = '' repl =