diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d8985ca13..bce002c99 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -42,6 +42,7 @@ The following people have contributed to the development of Rich: - [Henry Mai](https://github.com/tanducmai) - [Luka Mamukashvili](https://github.com/UltraStudioLTD) - [Alexander Mancevice](https://github.com/amancevice) +- [MiƂosz Matuszewski](https://github.com/miloszmat123) - [Will McGugan](https://github.com/willmcgugan) - [Paul McGuire](https://github.com/ptmcg) - [Antony Milne](https://github.com/AntonyMilneQB) diff --git a/rich/console.py b/rich/console.py index 3ec9a8aab..490387c54 100644 --- a/rich/console.py +++ b/rich/console.py @@ -997,7 +997,7 @@ def size(self) -> ConsoleDimensions: """ if self._width is not None and self._height is not None: - return ConsoleDimensions(self._width - self.legacy_windows, self._height) + return ConsoleDimensions(self._width, self._height) if self.is_dumb_terminal: return ConsoleDimensions(80, 25) diff --git a/tests/test_console.py b/tests/test_console.py index 407a138ec..3b76aab1e 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -180,6 +180,17 @@ def get_terminal_size_mock_impl(fileno: int = None) -> Tuple[int, int]: assert (w, h) == expected_size +def test_size_size_assigment(): + console = Console() + econsole = Console(stderr=True) + + assert (console.size, econsole.size) + + econsole.size = console.size + + assert (console.size, econsole.size) + + def test_repr(): console = Console() assert isinstance(repr(console), str)