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>
This commit is contained in:
parent
79a7a86d4d
commit
ea5195ccaf
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user