From 1e973232dfd732f66df4ea77b9db2a5fdc5fc939 Mon Sep 17 00:00:00 2001 From: night0721 Date: Tue, 12 Nov 2024 11:57:27 +0000 Subject: [PATCH] Avoid getting window size when in cat mode --- vip.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vip.c b/vip.c index 19edc70..c5a495c 100644 --- a/vip.c +++ b/vip.c @@ -1015,10 +1015,6 @@ void handle_sigwinch(int ignore) int main(int argc, char **argv) { - if (get_window_size(&rows, &cols) == -1) { - die("get_window_size"); - } - struct sigaction sa; sa.sa_handler = handle_sigwinch; sa.sa_flags = SA_RESTART; @@ -1036,6 +1032,9 @@ int main(int argc, char **argv) if (argc > 2 && !strcmp(argv[1], "-c")) { cat_mode = 1; } else { + if (get_window_size(&rows, &cols) == -1) { + die("get_window_size"); + } bprintf("\033[?1049h\033[2J\033[2q"); newt = oldt;