readline: fix for unicode prompts
prompt length is char length, not byte length
This commit is contained in:
parent
0c47219a72
commit
0dba28b5c2
@ -136,7 +136,7 @@ Interface.prototype.setPrompt = function(prompt, length) {
|
|||||||
} else {
|
} else {
|
||||||
var lines = prompt.split(/[\r\n]/);
|
var lines = prompt.split(/[\r\n]/);
|
||||||
var lastLine = lines[lines.length - 1];
|
var lastLine = lines[lines.length - 1];
|
||||||
this._promptLength = Buffer.byteLength(lastLine);
|
this._promptLength = lastLine.length;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user