aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxxf <ff@fxxf.me>2022-06-19 18:47:48 +0300
committerEli Schwartz <eschwartz93@gmail.com>2022-06-24 00:17:56 -0400
commit650cea3d08693b83892b1d63b947b7c760cdf639 (patch)
tree4b80fcb741c3d37dc26ce65380082d5f77dbc617
parent1a3d29dd0e535dc18039e270e47a2ba2f9c9d3a3 (diff)
downloadmeson-650cea3d08693b83892b1d63b947b7c760cdf639.zip
meson-650cea3d08693b83892b1d63b947b7c760cdf639.tar.gz
meson-650cea3d08693b83892b1d63b947b7c760cdf639.tar.bz2
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
-rw-r--r--mesonbuild/mconf.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index cd2b2e3..aa49949 100644
--- a/mesonbuild/mconf.py
+++ b/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)