-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
steps
chafa some_file.png > output.anstextual-paint output.ans
what happened?
Traceback (most recent call last):
File "/home/gaz/π»/lib/python3.12/site-packages/textual_paint/paint.py", line 1154, in open_from_file_path
go_ahead()
File "/home/gaz/π»/lib/python3.12/site-packages/textual_paint/paint.py", line 1122, in go_ahead
new_image = AnsiArtDocument.decode_based_on_file_extension(content, file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gaz/π»/lib/python3.12/site-packages/textual_paint/ansi_art_document.py", line 1048, in decode_based_on_file_extension
return AnsiArtDocument.from_ansi(content.decode("utf-8"), default_bg, default_fg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gaz/π»/lib/python3.12/site-packages/textual_paint/ansi_art_document.py", line 499, in from_ansi
for instruction in ansi.instructions():
^^^^^^^^^^^^^^^^^
File "/home/gaz/π»/lib/python3.12/site-packages/stransi/ansi.py", line 50, in instructions
yield from escape.instructions()
^^^^^^^^^^^^^^^^^^^^^
File "/home/gaz/π»/lib/python3.12/site-packages/stransi/escape.py", line 58, in instructions
while token := next(tokens, None):
^^^^^^^^^^^^^^^^^^
File "/home/gaz/π»/lib/python3.12/site-packages/stransi/escape.py", line 42, in tokens
yield Token(kind=kind, data=int(param))
^^^^^^^^^
ValueError: invalid literal for int() with base 10: '?25'
An unexpected error occurred while reading:
/home/gaz/src/bitplane.net/~/doc/thoughts/lens/words/src/1.1.library.ans
Why?
chafa turns the cursor off when it draws and on again afterwards:
^[[?25l(hide)^[[?25h(show)
stransi tries to int('?25') and fails. This bug and fix have been open for a while, so it might be better to filter here or patch it or something.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
