Skip to content

🚸 Don't truncate code lines in traceback when formatted with Rich#1695

Open
YuriiMotov wants to merge 2 commits intomasterfrom
dont-truncate-traceback-lines
Open

🚸 Don't truncate code lines in traceback when formatted with Rich#1695
YuriiMotov wants to merge 2 commits intomasterfrom
dont-truncate-traceback-lines

Conversation

@YuriiMotov
Copy link
Copy Markdown
Member

@YuriiMotov YuriiMotov commented Apr 15, 2026

When tracebacks are formatted with Rich, code lines are currently truncated to 88 characters (or less if terminal width is less).

This PR:

  • Makes it display full line if terminal width is large enough
  • Allows configuring it to wrap text instead of truncating it if terminal width is small

Small terminal width (before - after):

Screenshot from 2026-04-16 01-06-26 image

After is with pretty_exceptions_word_wrap=True


Wide terminal (before - after):

image image

If the idea is accepted, I will need to add a test for code example with word wrapping

@YuriiMotov YuriiMotov added the feature New feature, enhancement or request label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature, enhancement or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants