Skip to content

Commit fcf99e4

Browse files
committed
repl: fix persistent history
1 parent 02388db commit fcf99e4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/internal/repl.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ module.paths = require('module')._nodeModulePaths(module.filename);
2626

2727
function createRepl(env, cb) {
2828
const opts = {
29-
useGlobal: true,
30-
ignoreUndefined: false
29+
ignoreUndefined: false,
30+
terminal: process.stdout.isTTY,
31+
useGlobal: true
3132
};
3233

3334
if (parseInt(env.NODE_NO_READLINE)) {
@@ -57,8 +58,8 @@ function createRepl(env, cb) {
5758
}
5859

5960
const repl = REPL.start(opts);
60-
if (opts.terminal && env.NODE_REPL_HISTORY_PATH) {
61-
return setupHistory(repl, env.NODE_REPL_HISTORY_PATH, cb);
61+
if (opts.terminal && env.NODE_REPL_HISTORY_FILE) {
62+
return setupHistory(repl, env.NODE_REPL_HISTORY_FILE, cb);
6263
}
6364
repl._historyPrev = _replHistoryMessage;
6465
cb(null, repl);
@@ -158,7 +159,7 @@ function _replHistoryMessage() {
158159
if (this.history.length === 0) {
159160
this._writeToOutput(
160161
'\nPersistent history support disabled. ' +
161-
'Set the NODE_REPL_HISTORY_PATH environment variable to ' +
162+
'Set the NODE_REPL_HISTORY_FILE environment variable to ' +
162163
'a valid, user-writable path to enable.\n'
163164
);
164165
this._refreshLine();

0 commit comments

Comments
 (0)