Add minimum terminal size. Fixes #128
This commit is contained in:
parent
e288da8de2
commit
1f7f76e078
1 changed files with 4 additions and 2 deletions
|
@ -65,9 +65,11 @@ def create_config() -> Config:
|
|||
# 0. Check term size
|
||||
try:
|
||||
term_len, term_lines = os.get_terminal_size().columns, os.get_terminal_size().lines
|
||||
if term_len < 2 * asc_width + 4 or term_lines < 30:
|
||||
term_len_min = 2 * asc_width + 4
|
||||
term_lines_min = 30
|
||||
if term_len < term_len_min or term_lines < term_lines_min:
|
||||
printc(f'&cWarning: Your terminal is too small ({term_len} * {term_lines}). \n'
|
||||
f'Please resize it for better experience.')
|
||||
f'Please resize it to at least ({term_len_min} * {term_lines_min}) for better experience.')
|
||||
input('Press enter to ignore...')
|
||||
except:
|
||||
# print('Warning: We cannot detect your terminal size.')
|
||||
|
|
Loading…
Reference in a new issue