Skip to content

Commit f636f15

Browse files
BridgeARaddaleax
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 3e0978d commit f636f15

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/repl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ function REPLServer(prompt,
573573
sawSIGINT = false;
574574
return;
575575
}
576-
self.output.write('(To exit, press ^C again or type .exit)\n');
576+
self.output.write('(To exit, press ^C again or ^D or type .exit)\n');
577577
sawSIGINT = true;
578578
} else {
579579
sawSIGINT = false;
@@ -1428,6 +1428,8 @@ function defineDefaultCommands(repl) {
14281428
var line = `.${name}${cmd.help ? spaces + cmd.help : ''}\n`;
14291429
this.outputStream.write(line);
14301430
}
1431+
this.outputStream.write('\nPress ^C to abort current expression, ' +
1432+
'^D to exit the repl\n');
14311433
this.displayPrompt();
14321434
}
14331435
});

test/parallel/test-repl-editor.js

+1-1
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

+2
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)