From 57f062ac49ebf08ed513d7e4c3ec6c7f1ae21de2 Mon Sep 17 00:00:00 2001 From: Forza Date: Sun, 12 Jan 2025 10:46:33 +0100 Subject: [PATCH] fsmon: Correct minimum label length Correctly handle minimum label length when displaying UUIDs instead of labels. --- fsmon.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fsmon.py b/fsmon.py index 9eb80b3..0bf5c89 100755 --- a/fsmon.py +++ b/fsmon.py @@ -421,10 +421,13 @@ def display_ui(stdscr, btrfs_fs, fs_labels): stdscr.attroff(curses.color_pair(COLOR_FOOTER)) # Determine the maximum label length - max_label_len = max( - len(fs_labels[u]) - for u in uuids - ) + if use_labels: + max_label_len = max( + len(fs_labels[u]) + for u in uuids + ) + else: + max_label_len = 36 # Length of fixed columns combined fixed_cols = COL_READ_BW + COL_WRITE_BW + COL_IOPS