From 0dba28b5c29201a026a86e1d73b3c3c88a163b7d Mon Sep 17 00:00:00 2001 From: Tim Macfarlane Date: Fri, 29 Jun 2012 10:33:58 +0100 Subject: [PATCH] readline: fix for unicode prompts prompt length is char length, not byte length --- lib/readline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/readline.js b/lib/readline.js index e6b57927791..1dc755fa266 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -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; } };