Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
repl: add more information
This adds information about how to close the repl.
  • Loading branch information
BridgeAR committed Feb 21, 2019
commit af487603eca8be42b71729c1253136726ee50b98
4 changes: 3 additions & 1 deletion lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ function REPLServer(prompt,
sawSIGINT = false;
return;
}
self.output.write('(To exit, press ^C again or type .exit)\n');
self.output.write('(To exit, press ^C again or ^D or type .exit)\n');
sawSIGINT = true;
} else {
sawSIGINT = false;
Expand Down Expand Up @@ -1430,6 +1430,8 @@ function defineDefaultCommands(repl) {
var line = `.${name}${cmd.help ? spaces + cmd.help : ''}\n`;
this.outputStream.write(line);
}
this.outputStream.write('\nPress ^C to abort current expression, ' +
'^D to exit the repl\n');
this.displayPrompt();
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function run({ input, output, event, checkTerminalCodes = true }) {
const tests = [
{
input: '',
output: '\n(To exit, press ^C again or type .exit)',
output: '\n(To exit, press ^C again or ^D or type .exit)',
event: { ctrl: true, name: 'c' }
},
{
Expand Down
2 changes: 2 additions & 0 deletions test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ const errorTests = [
/\.help/,
/\.load/,
/\.save/,
'',
'Press ^C to abort current expression, ^D to exit the repl',
/'thefourtheye'/
]
},
Expand Down