From 89010d90b90954f94013c99519796b40cf78289c Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 21 Nov 2022 22:48:13 +0000 Subject: [PATCH] Ensure negative height is not given to `whiptail` Starting with release [0.52.22](https://github.com/mlichvar/newt/releases/tag/r0-52-22), providing a negative height was leading to the items in a menu not being displayed Same as https://github.com/marwano/whiptail/pull/2 --- whiptail/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whiptail/__init__.py b/whiptail/__init__.py index 5aaaf57..1128e61 100644 --- a/whiptail/__init__.py +++ b/whiptail/__init__.py @@ -306,7 +306,7 @@ def calc_height(self, msg: str) -> List[str]: else: height = self.height - return [str(height - height_offset)] + return [str(max(0, height - height_offset))] def menu( self,