Resize output horizontally and vertically based on current terminal size.

This commit is contained in:
JustinOros
2025-08-06 14:19:16 -07:00
parent b53662b1ea
commit 0ff37d0679
+2 -2
View File
@@ -194,14 +194,14 @@ def main():
config = load_or_create_config()
use_color = not args.no_color
show_line_numbers = args.lines
term_height = get_terminal_size().lines
limit = args.n if args.n else max(5, term_height - 10)
sort_key = 'cpu'
reverse = True
refresh_count = 0
start_time = time.time()
while True:
term_height = get_terminal_size().lines
limit = args.n if args.n else max(1, term_height - 3)
elapsed = time.time() - start_time
show_quit = True
print_processes(limit, sort_key, reverse, show_quit, use_color, show_line_numbers, config=config)