diff --git a/lib/repl.js b/lib/repl.js index 6621a4d9e8131e..eb9152d9ce0266 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -986,7 +986,9 @@ function REPLServer(prompt, clearPreview(key); if (!reverseSearch(d, key)) { ttyWrite(d, key); - showPreview(); + if (key.name !== 'escape') { + showPreview(); + } } return; } diff --git a/test/parallel/test-repl-history-navigation.js b/test/parallel/test-repl-history-navigation.js index 527cf235bddd21..29cb7816f0feb0 100644 --- a/test/parallel/test-repl-history-navigation.js +++ b/test/parallel/test-repl-history-navigation.js @@ -393,7 +393,7 @@ const tests = [ // 10. Word right. Cleanup '\x1B[0K', '\x1B[3G', '\x1B[7C', ' // n', '\x1B[10G', // 11. ESCAPE - '\x1B[0K', ' // n', '\x1B[10G', '\x1B[0K', + '\x1B[0K', // 12. ENTER '\r\n', 'Uncaught ReferenceError: functio is not defined\n',