aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui-curses.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-curses.c b/ui-curses.c
index 569b2ca..30e8c94 100644
--- a/ui-curses.c
+++ b/ui-curses.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
@@ -300,7 +301,7 @@ static void ui_resize(Ui *ui) {
struct winsize ws;
int width, height;
- if (ioctl(0, TIOCGWINSZ, &ws) == -1) {
+ if (ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1) {
getmaxyx(stdscr, height, width);
} else {
width = ws.ws_col;