diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-05-01 13:58:06 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-05-02 03:11:07 +0200 |
commit | ea5195ccaf6d51262c9089c2ec5c6f5634bc12b5 (patch) | |
tree | 1f043dca6d1665d487b9e7c12a56e3279b26c18a /lib | |
parent | 79a7a86d4d56625fe21be227ecf66ddabc49e86f (diff) | |
download | android-node-v8-ea5195ccaf6d51262c9089c2ec5c6f5634bc12b5.tar.gz android-node-v8-ea5195ccaf6d51262c9089c2ec5c6f5634bc12b5.tar.bz2 android-node-v8-ea5195ccaf6d51262c9089c2ec5c6f5634bc12b5.zip |
repl: do not save history for non-terminal repl
When running in non-TTY mode - the `repl.history` is `undefined` and
is not actually populated. Saving it will result in a crashes of
subsequent repl runs.
Fix: https://github.com/iojs/io.js/issues/1574
PR-URL: https://github.com/iojs/io.js/pull/1575
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/repl.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 6fc5eefc1b..f2fea166a6 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -57,7 +57,7 @@ function createRepl(env, cb) { } const repl = REPL.start(opts); - if (env.NODE_REPL_HISTORY_PATH) { + if (opts.terminal && env.NODE_REPL_HISTORY_PATH) { return setupHistory(repl, env.NODE_REPL_HISTORY_PATH, cb); } repl._historyPrev = _replHistoryMessage; |