Weird formatting of colored prompt message
I cut a similar issue to the node-promptly module earlier: IndigoUnited/node-promptly#2
When the prompt contains colored/formatted text, the cursor is indented far to the right.
I skimmed through the code, and I think I see where the issue is: https://github.com/isaacs/read/blob/master/lib/read.js#L56
Formatted strings end up with ANSI color codes are part of the string. Looking up the length property on them returns a misleading result. Would you accept a patch to strip ANSI codes before reading the length of the prompt?
You need to calculate the length of the prompt and pass it when calling setPrompt(), see #21 and https://github.com/joyent/node/issues/3860.
A modified version of read that allows for this is here:
https://github.com/freeformsystems/cli-input/blob/master/lib/read.js