| 1 |
--- |
| 2 |
title: "Natively inserted ANSI escape sequence characters break alignment of Panel." |
| 3 |
alt_titles: |
| 4 |
- "Escape codes break alignment." |
| 5 |
--- |
| 6 |
|
| 7 |
If you print ansi escape sequences for color and style you may find the output breaks your output. |
| 8 |
You may find that border characters in Panel and Table are in the wrong place, for example. |
| 9 |
|
| 10 |
As a general rule, you should allow Rich to generate all ansi escape sequences, so it can correctly account for these invisible characters. |
| 11 |
If you can't avoid a string with escape codes, you can convert it to an equivalent `Text` instance with `Text.from_ansi`. |