Skip to content

Commit

Permalink
repl: remove preview when press escape
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
meixg authored and sxa committed Mar 7, 2022
1 parent 03ebca8 commit d6b1a4a
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 d6b1a4a

Please sign in to comment.