[go: nahoru, domu]

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

[REQUEST] Print traceback without borders #2936

Open
vladmandic opened this issue Apr 25, 2023 Discussed in #2925 · 7 comments
Open

[REQUEST] Print traceback without borders #2936

vladmandic opened this issue Apr 25, 2023 Discussed in #2925 · 7 comments

Comments

@vladmandic
Copy link
vladmandic commented Apr 25, 2023

Discussed in #2925

Originally posted by vladmandic April 14, 2023
I've search the docs, but can't seem to find how to disable borders when using console.print_exception?

I like them visually, but they do result in a lot of copy-paste formatting problems when people try to post a traceback to (for example) github issues.

Best I could find so far is to paint them black, but that doesn't resolve original issue (painting with none does not work):

console = Console(log_time=True, log_time_format='%H:%M:%S-%f', theme=Theme({
    "traceback.border": "black",
    "traceback.border.syntax_error": "black",
}))

Also, i don't see a style param that is used for "locals" borders at all?
Its just printed as yellow no matter what.

@vladmandic vladmandic changed the title Print traceback without borders [REQUEST] Print traceback without borders Apr 25, 2023
@github-actions
Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@t-mangoe
Copy link

As a trial, I implemented the option no_border to disable borders in my local environment.
rich_issue2936_code
If this option is set to true, the borders on both sides are not printed. How about this?
rich_issue2936

@vladmandic
Copy link
Author

love it!
just to confirm, the actual line length of each line is not padded with spaces after text end? because that's what's causing undesired wrapping when doing copy&paste.

@t-mangoe
Copy link

@vladmandic
Thank you for your comment!

the actual line length of each line is not padded with spaces after text end?

Unfortunately, the each line is padded with spaces.

@vladmandic
Copy link
Author

too bad, but still worth having this fix!

@t-mangoe
Copy link
t-mangoe commented Jun 3, 2023

too bad, but still worth having this fix!

Thanks. I am considering sending a PR, if I can.

But, I have never sent PR to rich, and therefore I don't know when it will be.
So, I am glad that you'll be patient.

@YodaEmbedding
Copy link
YodaEmbedding commented Jul 1, 2023

It would be great if this could be controlled via a theme option that we could set globally for all projects, e.g.

# ~/.config/rich/config

[theme]
border = "no_side"  # no borders on left/right sides

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants