Skip to content

Commit d6b1a4a

Browse files
meixgsxa
authored andcommittedMar 7, 2022
repl: remove preview when press escape
Fix: #42040 PR-URL: #42053 Fixes: #42040 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 03ebca8 commit d6b1a4a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎lib/repl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,9 @@ function REPLServer(prompt,
986986
clearPreview(key);
987987
if (!reverseSearch(d, key)) {
988988
ttyWrite(d, key);
989-
showPreview();
989+
if (key.name !== 'escape') {
990+
showPreview();
991+
}
990992
}
991993
return;
992994
}

‎test/parallel/test-repl-history-navigation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ const tests = [
393393
// 10. Word right. Cleanup
394394
'\x1B[0K', '\x1B[3G', '\x1B[7C', ' // n', '\x1B[10G',
395395
// 11. ESCAPE
396-
'\x1B[0K', ' // n', '\x1B[10G', '\x1B[0K',
396+
'\x1B[0K',
397397
// 12. ENTER
398398
'\r\n',
399399
'Uncaught ReferenceError: functio is not defined\n',

0 commit comments

Comments
 (0)
Please sign in to comment.