Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
7 tasks done
brot opened this issue Jan 3, 2023 · 1 comment · May be fixed by #528
Open
7 tasks done

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

brot opened this issue Jan 3, 2023 · 1 comment · May be fixed by #528
Labels
feature New feature, enhancement or request

Comments

@brot
Copy link

brot commented Jan 3, 2023

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to Typer but to Click.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

import 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()

Description

If 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 Solution

So 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 Code

app = typer.Typer(pretty_exceptions_with=120)

Alternatives

No response

Operating System

macOS

Operating System Details

No response

Typer Version

0.7.0

Python Version

3.11.1

Additional Context

No response

@brot brot added the feature New feature, enhancement or request label Jan 3, 2023
@indiVar0508
Copy link

hi, would it be okay if I made a PR for it?

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 a pull request may close this issue.

2 participants