bpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size#29046
Merged
ambv merged 3 commits intopython:mainfrom Oct 19, 2021
Merged
bpo-42174: fallback to sane values if the columns or lines are 0 in get_terminal_size#29046ambv merged 3 commits intopython:mainfrom
ambv merged 3 commits intopython:mainfrom
Conversation
…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>
Member
Author
|
@willmcgugan, sorry to bother. Do you have any opinions about this? |
|
That makes sense. I'm essentially doing the same thing in Rich. |
FFY00
commented
Oct 19, 2021
Doc/library/shutil.rst
Outdated
Comment on lines
+808
to
+809
| The ``fallback`` values are also used if :func:`os.get_terminal_size` | ||
| returns zeroes. |
Member
Author
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
Yeah, VScode reformatted it wrong for me and I didn't notice.
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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