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

bpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size #29046

Merged
merged 3 commits into from
Oct 19, 2021

Conversation

FFY00
Copy link
Member

@FFY00 FFY00 commented Oct 19, 2021

I considered only falling back when both were 0, but that still seems
wrong, and the highly popular rich[1] library does it this way, so I
thought we should probably inherit that behavior.

[1] https://github.com/willmcgugan/rich

Signed-off-by: Filipe Laíns lains@riseup.net

https://bugs.python.org/issue42174

…et_terminal_size

I considered only falling back when both were 0, but that still seems
wrong, and the highly popular rich[1] library does it this way, so I
thought we should probably inherit that behavior.

[1] https://github.com/willmcgugan/rich

Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00
Copy link
Member Author

FFY00 commented Oct 19, 2021

@willmcgugan, sorry to bother. Do you have any opinions about this?

@willmcgugan
Copy link

That makes sense. I'm essentially doing the same thing in Rich.

Comment on lines 808 to 809
The ``fallback`` values are also used if :func:`os.get_terminal_size`
returns zeroes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``fallback`` values are also used if :func:`os.get_terminal_size`
returns zeroes.
The ``fallback`` values are also used if :func:`os.get_terminal_size`
returns zeroes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, VScode reformatted it wrong for me and I didn't notice.

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

Successfully merging this pull request may close these issues.

5 participants