From 97dbc608db4e0c34ab46cce9fe91ae102dcf06d5 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 23 Apr 2021 03:24:20 +0000 Subject: [PATCH] raise TerminalTooSmallError --- src/plotman/interactive.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plotman/interactive.py b/src/plotman/interactive.py index d10a2b22..73464e41 100644 --- a/src/plotman/interactive.py +++ b/src/plotman/interactive.py @@ -9,6 +9,9 @@ from plotman.job import Job +class TerminalTooSmallError(Exception): + pass + class Log: def __init__(self): self.entries = [] @@ -349,4 +352,9 @@ def run_interactive(): code = locale.getpreferredencoding() # Then use code as the encoding for str.encode() calls. - curses.wrapper(curses_main) + try: + curses.wrapper(curses_main) + except curses.error as e: + raise TerminalTooSmallError( + "Your terminal may be too small, try making it bigger.", + ) from e