GeezerVison is showing github.com — Crash when print ANSI escape code to color output text · Issue #915 · bpython/bpython
Crash when print ANSI escape code to color output text #915DescriptionTried printing out an ANSI escape sequence that changes the color of terminal output to red (see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), and it crashed. If I don't pass the end='' parameter to the print function, it works fine; looks like bpython was expecting the cursor to advance but only changing the color doesn't do that.
~ % bpython
bpython version 0.21 on top of Python 3.8.2 /Library/Developer/CommandLineTools/usr/bin/python3
>>> print('\033[91m', end='')
Traceback (most recent call last):
File "/Users/arian/Library/Python/3.8/bin/bpython", line 8, in <module>
sys.exit(main())
File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py", line 201, in main
exit_value = repl.mainloop(True, paste)
File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py", line 121, in mainloop
self.process_event_and_paint(e)
File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsies.py", line 95, in process_event_and_paint
array, cursor_pos = self.paint()
File "/Users/arian/Library/Python/3.8/lib/python/site-packages/bpython/curtsiesfrontend/repl.py", line 1610, in paint
assert cursor_row >= 0 and cursor_column >= 0, (
AssertionError: (-1, 74, 9, 0, 0)
Activityarian-deimling commented on Sep 25, 2021 ContributorAuthor More actions Can I work on this or are you going to? arian-deimling commented on Oct 2, 2021 ContributorAuthor More actions thomasballinger commented on Oct 7, 2021 arian-deimling commented on Oct 7, 2021 ContributorAuthor More actions @thomasballinger I'd be happy to look at this over the weekend. Do you want me to work on this or is there anything else that's more pressing? thomasballinger commented on Oct 7, 2021 This bug might even be the most pressing bug right now? It's been an issue for a long time though, so it's not urgent. It looks pretty involved, decisions made here about how we handle operationally blank output lines may have far-reaching effects.
I'm starting on some mypy types, that's a potential thing to work on if that's fun. In the autocompletion vein, you could take a look at #889 or #897 or similar. I'm interested in #826, which is related to the escape codes issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|