fix: handle the case where the last item of `four_column` results in being < 1 (COLUMNS <= 60) by falling back to `_col`, relevant issue #10211

pull/10537/head
fxxf 2 years ago committed by Eli Schwartz
parent 1a3d29dd0e
commit 650cea3d08
  1. 3
      mesonbuild/mconf.py

@ -112,7 +112,8 @@ class Conf:
"""
total_width = shutil.get_terminal_size(fallback=(160, 0))[0]
_col = max(total_width // 5, 20)
four_column = (_col, _col, _col, total_width - (3 * _col))
last_column = total_width - (3 * _col)
four_column = (_col, _col, _col, last_column if last_column > 1 else _col)
# In this case we don't have the choices field, so we can redistribute
# the extra 40 characters to val and desc
three_column = (_col, _col * 2, total_width // 2)

Loading…
Cancel
Save