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 @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
### Fixed
17
17
18
18
- Fixed issue with Segment._ split_cells https://github.com/Textualize/rich/pull/3506
19
+ - Fix auto detection of terminal size on Windows https://github.com/Textualize/rich/pull/2916
19
20
20
21
### Added
21
22
Original file line number Diff line number Diff line change @@ -87,5 +87,6 @@ The following people have contributed to the development of Rich:
87
87
- [ Pierro] ( https://github.com/xpierroz )
88
88
- [ Bernhard Wagner] ( https://github.com/bwagner )
89
89
- [ Aaron Beaudoin] ( https://github.com/AaronBeaudoin )
90
+ - [ L. Yeung] ( https://github.com/lewis-yeung )
90
91
- [ chthollyphile] ( https://github.com/chthollyphile )
91
92
- [ Jonathan Helmus] ( https://github.com/jjhelmus )
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