File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
- Progress track thread is now a daemon thread https://github.com/Textualize/rich/pull/3402
18
18
- Fixed cached hash preservation upon clearing meta and links https://github.com/Textualize/rich/issues/2942
19
19
- Fixed overriding the ` background_color ` of ` Syntax ` not including padding https://github.com/Textualize/rich/issues/3295
20
+ - Fix auto detection of terminal size on Windows https://github.com/Textualize/rich/pull/2916
20
21
21
22
### Changed
22
23
Original file line number Diff line number Diff line change @@ -85,3 +85,4 @@ The following people have contributed to the development of Rich:
85
85
- [ Pierro] ( https://github.com/xpierroz )
86
86
- [ Bernhard Wagner] ( https://github.com/bwagner )
87
87
- [ Aaron Beaudoin] ( https://github.com/AaronBeaudoin )
88
+ - [ L. Yeung] ( https://github.com/lewis-yeung )
Original file line number Diff line number Diff line change @@ -1005,19 +1005,13 @@ def size(self) -> ConsoleDimensions:
1005
1005
width : Optional [int ] = None
1006
1006
height : Optional [int ] = None
1007
1007
1008
- if WINDOWS : # pragma: no cover
1008
+ for file_descriptor in _STD_STREAMS_OUTPUT if WINDOWS else _STD_STREAMS :
1009
1009
try :
1010
- width , height = os .get_terminal_size ()
1010
+ width , height = os .get_terminal_size (file_descriptor )
1011
1011
except (AttributeError , ValueError , OSError ): # Probably not a terminal
1012
1012
pass
1013
- else :
1014
- for file_descriptor in _STD_STREAMS :
1015
- try :
1016
- width , height = os .get_terminal_size (file_descriptor )
1017
- except (AttributeError , ValueError , OSError ):
1018
- pass
1019
- else :
1020
- break
1013
+ else :
1014
+ break
1021
1015
1022
1016
columns = self ._environ .get ("COLUMNS" )
1023
1017
if columns is not None and columns .isdigit ():
You can’t perform that action at this time.
0 commit comments