-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
The overhaul of cell_len in Rich v14.3.0 doesn't seem to account for control characters.
from rich.cells import cell_len
for i in range(32):
char = chr(i)
char_len = cell_len(char)
print(f"{repr(char):6} {char_len}")Previously it looks like there was special handling for these codepoints, but now it reports a cell width of 1.
Lines 3 to 6 in 53757bc
| CELL_WIDTHS = [ | |
| (0, 0, 0), | |
| (1, 31, -1), | |
| (127, 159, -1), |
I'm surprised this change didn't break any tests, but I've not investigated Rich itself. I found this bug while investigating a problem in Textual:
Reactions are currently unavailable