Skip to content

Conversation

indiVar0508
Copy link

add parameter as suggested feature in issue #523

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@indiVar0508
Copy link
Author

Hi @tiangolo ,
Did you get a chance to review this PR

@Napo2k
Copy link

Napo2k commented Feb 12, 2024

I definitely would like for this to be merged in! @tiangolo

@svlandeg svlandeg added feature New feature, enhancement or request p3 labels Mar 1, 2024
@nikita-b
Copy link

Yes, feature looks really good. @tiangolo Could you please, review?

adding new attribute in DeveloperExceptionConfig to allow
setting width for rick traceback.
add `pretty_exceptions_width` in typer class to be used by
`DeveloperConfigException` to allow setting width of traceback
boxes.
@svlandeg svlandeg changed the title Add #523 ✨ Add a new parameter to set the width of the Rich exception output Apr 18, 2024

This comment was marked as outdated.

@svlandeg svlandeg changed the title ✨ Add a new parameter to set the width of the Rich exception output ✨ Add option to set the width of the Rich exception output Apr 18, 2024

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@svlandeg svlandeg marked this pull request as ready for review August 27, 2024 13:00
@svlandeg svlandeg removed their assignment Aug 27, 2024
@svlandeg svlandeg self-assigned this Aug 28, 2025
@svlandeg svlandeg marked this pull request as draft August 28, 2025 10:04

This comment was marked as outdated.

This comment was marked as outdated.

@svlandeg svlandeg marked this pull request as ready for review August 28, 2025 14:48
@svlandeg svlandeg removed their assignment Aug 28, 2025
@svlandeg svlandeg marked this pull request as draft September 1, 2025 09:13
@svlandeg svlandeg self-assigned this Sep 1, 2025
@svlandeg svlandeg marked this pull request as ready for review September 1, 2025 10:07
@svlandeg svlandeg removed their assignment Sep 1, 2025

This comment was marked as outdated.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 5, 2025

This comment was marked as resolved.

@svlandeg svlandeg self-assigned this Sep 6, 2025
@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Sep 15, 2025
Copy link
Contributor

@svlandeg svlandeg removed their assignment Sep 15, 2025
@YuriiMotov
Copy link
Member

YuriiMotov commented Sep 19, 2025

Is the intention of this PR to handle situations when it's impossible to determine the width of the terminal screen?

Currently you can specify the width of the terminal screen using TERMINAL_WIDTH ENV variable.

_TERMINAL_WIDTH = getenv("TERMINAL_WIDTH")
MAX_WIDTH = int(_TERMINAL_WIDTH) if _TERMINAL_WIDTH else None

See in the details
TERMINAL_WIDTH=70 python main.py
╭──────────────── Traceback (most recent call last) ─────────────────╮
│ /home/yurii/code/typer/motov/helloworld/main.py:33 in main         │
│                                                                    │
│   30 │   │   │   }                                                 │
│   31 │   │   }                                                     │
│   32 │   }                                                         │
│ ❱ 33 │   print(name + 3)                                           │
│   34                                                               │
│   35                                                               │
│   36 if __name__ == "__main__":                                    │
│                                                                    │
│ ╭──────────────────────────── locals ────────────────────────────╮ │
│ │ deep_dict_or_json = {                                          │ │
│ │                     │   'this_is_a_long_key': {                │ │
│ │                     │   │   'this_is_the_next_long_key': {     │ │
│ │                     │   │   │   'this_is_the_next_long_key': { │ │
│ │                     │   │   │   │                              │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │                          │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │                      │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │   │                  │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │   │   │              │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │   │   │   │          │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │   │   │   │   │      │ │
│ │                     'this_is_the_next_long_key': {             │ │
│ │                     │   │   │   │   │   │   │   │   │   │   │  │ │
│ │                     'and_once_again_a_very_long_key': {        │ │
│ │                     │   │   │   │   │   │   │   │   │   │   │  │ │
│ │                     │   'but_this_is_not_the_end': {           │ │
│ │                     │   │   │   │   │   │   │   │   │   │   │  │ │
│ │                     │   │   'end': True                        │ │
│ │                     │   │   │   │   │   │   │   │   │   │   │  │ │
│ │                     │   }                                      │ │
│ │                     │   │   │   │   │   │   │   │   │   │   │  │ │
│ │                     }                                          │ │
│ │                     │   │   │   │   │   │   │   │   │   │   }  │ │
│ │                     │   │   │   │   │   │   │   │   │   }      │ │
│ │                     │   │   │   │   │   │   │   │   }          │ │
│ │                     │   │   │   │   │   │   │   }              │ │
│ │                     │   │   │   │   │   │   }                  │ │
│ │                     │   │   │   │   │   }                      │ │
│ │                     │   │   │   │   }                          │ │
│ │                     │   │   │   }                              │ │
│ │                     │   │   }                                  │ │
│ │                     │   }                                      │ │
│ │                     }                                          │ │
│ │              name = 'morty'                                    │ │
│ ╰────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────╯
TypeError: can only concatenate str (not "int") to str

I think we don't need to change anything. Probably just document this ENV variable

@svlandeg svlandeg self-assigned this Sep 19, 2025
@svlandeg svlandeg removed their assignment Oct 7, 2025
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 p3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New setting to increase the width of the rich (exception) output

6 participants