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

BUG-3430 fix legacy window bug #3614

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rich/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions tests/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading