Skip to content

Commit ff64c67

Browse files
BridgeARdanbev
authored andcommitted
repl: add more information
This adds information about how to close the repl. PR-URL: #26240 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 8a273f1 commit ff64c67

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/repl.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ function REPLServer(prompt,
572572
sawSIGINT = false;
573573
return;
574574
}
575-
self.output.write('(To exit, press ^C again or type .exit)\n');
575+
self.output.write('(To exit, press ^C again or ^D or type .exit)\n');
576576
sawSIGINT = true;
577577
} else {
578578
sawSIGINT = false;
@@ -1430,6 +1430,8 @@ function defineDefaultCommands(repl) {
14301430
var line = `.${name}${cmd.help ? spaces + cmd.help : ''}\n`;
14311431
this.outputStream.write(line);
14321432
}
1433+
this.outputStream.write('\nPress ^C to abort current expression, ' +
1434+
'^D to exit the repl\n');
14331435
this.displayPrompt();
14341436
}
14351437
});

test/parallel/test-repl-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function run({ input, output, event, checkTerminalCodes = true }) {
4545
const tests = [
4646
{
4747
input: '',
48-
output: '\n(To exit, press ^C again or type .exit)',
48+
output: '\n(To exit, press ^C again or ^D or type .exit)',
4949
event: { ctrl: true, name: 'c' }
5050
},
5151
{

test/parallel/test-repl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ const errorTests = [
444444
/\.help/,
445445
/\.load/,
446446
/\.save/,
447+
'',
448+
'Press ^C to abort current expression, ^D to exit the repl',
447449
/'thefourtheye'/
448450
]
449451
},

0 commit comments

Comments
 (0)