Yours lib is awesome, I used it for years.
Now I have a little problem, a have fine formatting and print table separated.
Is any way to find printable text width to calculate table cell width?
If not I suggest add a function to count length of the text without sequences.
Of course I can add some regex to transform text before taking its length but it'll be nice to have it out of the box.
EDIT: some example
rx_omit_sequences = re.compile(r'(?:\033\[|\x9b)[0-?]*[!-/]*[@-~]')
def text_width(s: str) -> int:
return len(rx_omit_sequences.sub('', s))
s = f'{fg.red}This is red text!{fg.rs}'
print('-' * len(s))
print(s)
print('-' * text_width(s))

Yours lib is awesome, I used it for years.
Now I have a little problem, a have fine formatting and print table separated.
Is any way to find printable text width to calculate table cell width?
If not I suggest add a function to count length of the text without sequences.
Of course I can add some regex to transform text before taking its length but it'll be nice to have it out of the box.
EDIT: some example