-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.
Description
I'm running io.js inside LXC container console (lxc-console
) in Ubuntu 14.04 terminal.
When I press and hold an arrow key, node.js sometimes receives escape sequences splitted into multiple chunks:
$ node -e 'process.stdin.setRawMode(true);process.stdin.on("data", function(d){console.log(d)})'
<Buffer 1b 5b 44>
<Buffer 1b 5b 44>
<Buffer 1b>
<Buffer 5b 44>
<Buffer 1b 5b 44>
Here you can see \x1b[D
(arrow left) is broken into \x1b
+ [D
.
Readline doesn't handle those, because it assumes that the entire escape sequence is contained within a data chunk. So it skips escape character itself, and [D
is getting printed to the terminal:
$ node
> console.log('h[Dello world')
Here is a screenshot.
Trying to find a way to fix it at the moment. Any ideas?
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.