import copy
from decimal import Decimal
-from signal import signal, SIGINT, SIG_DFL
+from signal import signal, SIGINT, SIGWINCH, SIG_DFL
cols = {
# HDR: [Size, Scale, Description]
except:
pass
+def update_hdr_intr():
+ global hdr_intr
+
+ lines = get_terminal_lines()
+ if lines and lines > 3:
+ hdr_intr = lines - 3
+
+def resize_handler(signum, frame):
+ update_hdr_intr()
+
+
def init():
global sint
global count
global hdr
- global hdr_intr
global xhdr
global opfile
global sep
if xflag:
hdr = xhdr
- lines = get_terminal_lines()
- if lines:
- hdr_intr = lines - 3
+ update_hdr_intr()
# check if L2ARC exists
snap_stats()
count_flag = 1
signal(SIGINT, SIG_DFL)
+ signal(SIGWINCH, resize_handler)
while True:
if i == 0:
print_header()
break
count -= 1
- i = 0 if i == hdr_intr else i + 1
+ i = 0 if i >= hdr_intr else i + 1
time.sleep(sint)
if out: