|
1 |
| -import os |
| 1 | +import shutil |
2 | 2 | from typing import Any, Dict, List, Optional, Union
|
3 | 3 |
|
4 | 4 | from rich.markup import escape
|
@@ -95,7 +95,7 @@ def th(s: str) -> str:
|
95 | 95 | props.add_row(th("Inactivity duration"), inactivity_duration)
|
96 | 96 | props.add_row(th("Reservation"), run_spec.configuration.reservation or "-")
|
97 | 97 |
|
98 |
| - offers = Table(box=None, expand=os.get_terminal_size()[0] <= 110) |
| 98 | + offers = Table(box=None, expand=shutil.get_terminal_size(fallback=(120, 40)).columns <= 110) |
99 | 99 | offers.add_column("#")
|
100 | 100 | offers.add_column("BACKEND", style="grey58", ratio=2)
|
101 | 101 | offers.add_column("RESOURCES", ratio=4)
|
@@ -149,7 +149,7 @@ def th(s: str) -> str:
|
149 | 149 | def get_runs_table(
|
150 | 150 | runs: List[Run], verbose: bool = False, format_date: DateFormatter = pretty_date
|
151 | 151 | ) -> Table:
|
152 |
| - table = Table(box=None, expand=os.get_terminal_size()[0] <= 110) |
| 152 | + table = Table(box=None, expand=shutil.get_terminal_size(fallback=(120, 40)).columns <= 110) |
153 | 153 | table.add_column("NAME", style="bold", no_wrap=True, ratio=2)
|
154 | 154 | table.add_column("BACKEND", style="grey58", ratio=2)
|
155 | 155 | table.add_column("RESOURCES", ratio=3 if not verbose else 2)
|
|
0 commit comments