Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
repl: remove preview when press escape
Fix: #42040

PR-URL: #42053
Fixes: #42040
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
meixg authored and danielleadams committed Apr 24, 2022
1 parent 0d8f76f commit a88d4a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/repl.js
Expand Up @@ -986,7 +986,9 @@ function REPLServer(prompt,
clearPreview(key);
if (!reverseSearch(d, key)) {
ttyWrite(d, key);
showPreview();
if (key.name !== 'escape') {
showPreview();
}
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-history-navigation.js
Expand Up @@ -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',
Expand Down

0 comments on commit a88d4a2

Please sign in to comment.