Skip to content

Current Terminal size added in About popup #1540

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

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ Zeeshan Equbal <[email protected]>
Mounil K. Shah <[email protected]> <[email protected]>
Mounil K. Shah <[email protected]>
Vishwesh Pillai <[email protected]>
Sashank Ravipati <[email protected]>
Niloth P <[email protected]>
7 changes: 6 additions & 1 deletion tests/ui_tools/test_popups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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(
Expand Down Expand Up @@ -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) == (
Expand Down Expand Up @@ -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


Expand Down
5 changes: 5 additions & 0 deletions zulipterminal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import itertools
import os
import shutil
import signal
import sys
import time
Expand Down Expand Up @@ -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,
Expand All @@ -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",
)
Expand Down
7 changes: 6 additions & 1 deletion zulipterminal/ui_tools/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down Expand Up @@ -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),
],
),
]

Expand Down
Loading