New setting to increase the width of the rich (exception) output #1450
First Check
Commit to Help
Example Codeimport typer
app = typer.Typer()
@app.command()
def main(name: str = "morty"):
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}
}
}
}
}
}
}
}
}
}
}
}
}
print(name + 3)
if __name__ == "__main__":
app()DescriptionIf I want to include the locals in the nice rich output and such a local includes a very big and deep dictionary (e.g: Kubernetes pod description) the output is very long, although I have a lot of horizontal space in my terminal. Wanted SolutionSo I want to be able to increase the width of the yellow and red rich exception border to make the output more useful and readable Wanted Codeapp = typer.Typer(pretty_exceptions_with=120)AlternativesNo response Operating SystemmacOS Operating System DetailsNo response Typer Version0.7.0 Python Version3.11.1 Additional ContextNo response |
Answered by
YuriiMotov
Sep 19, 2025
Replies: 2 comments
|
hi, would it be okay if I made a PR for it? |
0 replies
|
Currently it fits this block in terminal width by default: So, I think the issue is solved. If, for some reasons, it fails to determine the width of the terminal screen correctly, you can specify it using or |
0 replies
Answer selected by
tiangolo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently it fits this block in terminal width by default: