code: func visualLength(runes []rune) int {
  	inEscapeSeq := false
  	length := 0
  
  	for _, r := range runes {
  		switch {
  		case inEscapeSeq:
  			if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {
  				inEscapeSeq = false
  			}
  		case r == '\x1b':
  			inEscapeSeq = true
  		default:
  			length++
  		}
  	}
  
  	return length
  }
docs: // visualLength returns the number of visible glyphs in s.