Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/dstack/_internal/cli/utils/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import shutil
from typing import Any, Dict, List, Optional, Union

from rich.markup import escape
Expand Down Expand Up @@ -95,7 +95,7 @@ def th(s: str) -> str:
props.add_row(th("Inactivity duration"), inactivity_duration)
props.add_row(th("Reservation"), run_spec.configuration.reservation or "-")

offers = Table(box=None, expand=os.get_terminal_size()[0] <= 110)
offers = Table(box=None, expand=shutil.get_terminal_size(fallback=(120, 40)).columns <= 110)
offers.add_column("#")
offers.add_column("BACKEND", style="grey58", ratio=2)
offers.add_column("RESOURCES", ratio=4)
Expand Down Expand Up @@ -149,7 +149,7 @@ def th(s: str) -> str:
def get_runs_table(
runs: List[Run], verbose: bool = False, format_date: DateFormatter = pretty_date
) -> Table:
table = Table(box=None, expand=os.get_terminal_size()[0] <= 110)
table = Table(box=None, expand=shutil.get_terminal_size(fallback=(120, 40)).columns <= 110)
table.add_column("NAME", style="bold", no_wrap=True, ratio=2)
table.add_column("BACKEND", style="grey58", ratio=2)
table.add_column("RESOURCES", ratio=3 if not verbose else 2)
Expand Down