diff --git a/tests/ui_tools/test_popups.py b/tests/ui_tools/test_popups.py index 878be178c4..fd0797e1e5 100644 --- a/tests/ui_tools/test_popups.py +++ b/tests/ui_tools/test_popups.py @@ -195,6 +195,8 @@ def mock_external_classes(self, mocker: MockerFixture) -> None: mocker.patch(MODULE + ".detected_python_in_full", lambda: "[Python version]") + terminal_size = "24 rows x 80 cols" + self.about_view = AboutView( self.controller, "About", @@ -208,6 +210,7 @@ def mock_external_classes(self, mocker: MockerFixture) -> None: maximum_footlinks=3, exit_confirmation_enabled=False, transparency_enabled=False, + terminal_size=terminal_size, ) @pytest.mark.parametrize( @@ -259,6 +262,7 @@ def test_feature_level_content( maximum_footlinks=3, exit_confirmation_enabled=False, transparency_enabled=False, + terminal_size="24 rows x 80 cols", ) assert len(about_view.feature_level_content) == ( @@ -299,7 +303,8 @@ def test_copied_content(self) -> None: #### Detected Environment Platform: WSL -Python: [Python version]""" +Python: [Python version] +Terminal Size: 24 rows x 80 cols""" assert self.about_view.copy_info == expected_output diff --git a/zulipterminal/core.py b/zulipterminal/core.py index a23b1596f1..d01cb4473f 100644 --- a/zulipterminal/core.py +++ b/zulipterminal/core.py @@ -4,6 +4,7 @@ import itertools import os +import shutil import signal import sys import time @@ -301,6 +302,9 @@ def popup_with_message(self, text: str, width: int) -> None: self.show_pop_up(NoticeView(self, text, width, "NOTICE"), "area:error") def show_about(self) -> None: + terminal_size = shutil.get_terminal_size() + terminal_size_str = f"{terminal_size.columns} cols x {terminal_size.lines} rows" + self.show_pop_up( AboutView( self, @@ -315,6 +319,7 @@ def show_about(self) -> None: maximum_footlinks=self.maximum_footlinks, exit_confirmation_enabled=self.exit_confirmation, transparency_enabled=self.transparency_enabled, + terminal_size=terminal_size_str, ), "area:help", ) diff --git a/zulipterminal/ui_tools/views.py b/zulipterminal/ui_tools/views.py index 6d01a82566..3a99c65299 100644 --- a/zulipterminal/ui_tools/views.py +++ b/zulipterminal/ui_tools/views.py @@ -1092,6 +1092,7 @@ def __init__( notify_enabled: bool, exit_confirmation_enabled: bool, transparency_enabled: bool, + terminal_size: str, ) -> None: self.feature_level_content = ( [("Feature level", str(server_feature_level))] @@ -1119,7 +1120,11 @@ def __init__( ), ( "Detected Environment", - [("Platform", PLATFORM), ("Python", detected_python_in_full())], + [ + ("Platform", PLATFORM), + ("Python", detected_python_in_full()), + ("Terminal Size", terminal_size), + ], ), ]