peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

Remove ANSI escape codes from prompt when counting Glyphs #80

Closed alvarolm closed 7 years ago

alvarolm commented 8 years ago

Avoids wrong glyphs counting causing faulty rendering.

peterh commented 7 years ago

Sorry for the late reply.

That will never work in liner on Windows, because I don't want to write a VT102-to-Windows-Console library. Since liner is an opinionated cross-platform library, that will never work in liner. If you need colour, I recommend finding another command line input package. Sorry about that.

"Fixed" by returning an error immediately if there are any unprintable runes in the prompt string.