Skip to content

Commit

Permalink
Merge pull request #154 from altendky/warn_about_terminal_size_maybe_…
Browse files Browse the repository at this point in the history
…too_small
  • Loading branch information
altendky authored Apr 30, 2021
2 parents c068ab7 + 2763b2b commit f842acc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/plotman/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from plotman.job import Job


class TerminalTooSmallError(Exception):
pass

class Log:
def __init__(self):
self.entries = []
Expand Down Expand Up @@ -333,4 +336,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

0 comments on commit f842acc

Please sign in to comment.