Skip to content

Commit

Permalink
Resolve potential bug in MOTD in Docker (sanic-org#2331)
Browse files Browse the repository at this point in the history
* Resolve potential bug in MOTD in Docker
  • Loading branch information
ahopkins authored and ChihweiLHBird committed Jun 1, 2022
1 parent c6ac735 commit 9a6b820
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sanic/application/motd.py
Expand Up @@ -64,8 +64,10 @@ def __init__(self, *args, **kwargs) -> None:
self.set_variables()

def set_variables(self): # no cov
fallback = (80, 24)
terminal_width = min(get_terminal_size(fallback=fallback).columns, 108)
fallback = (108, 24)
terminal_width = max(
get_terminal_size(fallback=fallback).columns, fallback[0]
)
self.max_value_width = terminal_width - fallback[0] + 36

self.key_width = 4
Expand Down

0 comments on commit 9a6b820

Please sign in to comment.