$OpenBSD: patch-src_screen_init_c,v 1.1 2017/03/27 17:26:10 dcoppa Exp $
--- src/screen_init.c.orig	Mon Mar 20 21:59:49 2017
+++ src/screen_init.c	Mon Mar 27 18:44:28 2017
@@ -26,7 +26,9 @@
 #include "options.h"
 #include "colors.h"
 
+#include <sys/ioctl.h>
 #include <stdlib.h>
+#include <termios.h>
 
 #ifndef NCMPC_MINI
 /** welcome message time [s] */
@@ -63,6 +65,12 @@ screen_exit(void)
 void
 screen_resize(struct mpdclient *c)
 {
+	struct winsize ws;
+	if (ioctl(fileno(stdout), TIOCGWINSZ, &ws) == 0) { 
+		LINES = ws.ws_row;
+		COLS = ws.ws_col;
+	}
+
 	const unsigned cols = COLS, rows = LINES;
 	if (cols < SCREEN_MIN_COLS || rows < SCREEN_MIN_ROWS) {
 		screen_exit();
