From 19f6544923faf3760d20658a0926e41d5e10b0db Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Fri, 3 Dec 2021 13:27:16 +0200 Subject: [PATCH] Resolve potential bug in MOTD in Docker (#2331) * Resolve potential bug in MOTD in Docker --- sanic/application/motd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sanic/application/motd.py b/sanic/application/motd.py index 27c36663..32825b12 100644 --- a/sanic/application/motd.py +++ b/sanic/application/motd.py @@ -64,8 +64,10 @@ class MOTDTTY(MOTD): 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