From cbb9f606333774f4de6f639891cd1411419ecf2a Mon Sep 17 00:00:00 2001 From: wrmr Date: Sat, 9 Nov 2024 01:51:42 -0500 Subject: use actual console size for nav_lines(), instead of dummy value --- con.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 con.c (limited to 'con.c') diff --git a/con.c b/con.c new file mode 100644 index 0000000..f00d379 --- /dev/null +++ b/con.c @@ -0,0 +1,14 @@ +#include +#include + +unsigned con_lines(void) { + struct winsize w; + ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); + return w.ws_row; +} + +unsigned con_cols(void) { + struct winsize w; + ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); + return w.ws_col; +} -- cgit 1.4.1-2-gfad0