From 49b1a0ca5ce68407821de10aa24f586b58ab1926 Mon Sep 17 00:00:00 2001 From: Zach Welch Date: Thu, 22 Feb 2018 23:54:20 -0800 Subject: [PATCH] issue #1083: limit history size to fix crash (#1436) The calulated limit ensures that at least one message will be displayed. Using a hard-coded constant is ugly, but such are scattered throughout the script. Untangling those constants has been left for future patch. --- mycroft/client/text/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mycroft/client/text/main.py b/mycroft/client/text/main.py index 59526cc052..c413193e75 100644 --- a/mycroft/client/text/main.py +++ b/mycroft/client/text/main.py @@ -840,6 +840,9 @@ def handle_cmd(cmd): lines = int(_get_cmd_param(cmd)) if lines < 1: lines = 1 + max_chat_area = curses.LINES - 7 + if lines > max_chat_area: + lines = max_chat_area cy_chat_area = lines elif "skills" in cmd: # List loaded skill