Skip to content

Commit

Permalink
Fix garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
princejwesley committed Aug 13, 2016
1 parent 0be2947 commit 9327a39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function* emitKeys(stream) {
// backspace or ctrl+h
key.name = 'backspace';
key.meta = escaped;
} else if (ch === '\x1b' || (s === '\x1b')) {
} else if (s === '\x1b') {
// escape key
key.name = 'escape';
key.meta = escaped;
Expand All @@ -380,7 +380,7 @@ function* emitKeys(stream) {

key.sequence = s;

if (key.name !== undefined) {
if (s.length !== 0 && (key.name !== undefined || escaped)) {
/* Named character or sequence */
stream.emit('keypress', escaped ? undefined : s, key);
} else if (s.length === 1) {
Expand Down

0 comments on commit 9327a39

Please sign in to comment.