Currently only \e[#m works, where # is a number, but many more escape sequences exist. Printing out to a terminal might be one way to get the actual length, but there could be many more edge cases with that. Handling them as individual characters is probably still better.
Currently only
\e[#m
works, where#
is a number, but many more escape sequences exist. Printing out to a terminal might be one way to get the actual length, but there could be many more edge cases with that. Handling them as individual characters is probably still better.