4
"github.com/mattn/go-runewidth"
8
// Finds the control character sequences (like colors)
9
var ctrlFinder = regexp.MustCompile("\x1b\x5b[0-9]+\x6d")
11
func escapeAwareRuneCountInString(s string) int {
12
n := runewidth.StringWidth(s)
13
for _, sm := range ctrlFinder.FindAllString(s, -1) {