Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
readline: fix for unicode prompts
Browse files Browse the repository at this point in the history
prompt length is char length, not byte length
  • Loading branch information
refractalize authored and bnoordhuis committed Jul 6, 2012
1 parent 0c47219 commit 0dba28b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/readline.js
Expand Up @@ -136,7 +136,7 @@ Interface.prototype.setPrompt = function(prompt, length) {
} else {
var lines = prompt.split(/[\r\n]/);
var lastLine = lines[lines.length - 1];
this._promptLength = Buffer.byteLength(lastLine);
this._promptLength = lastLine.length;
}
};

Expand Down

0 comments on commit 0dba28b

Please sign in to comment.