login

<     >

2015-07-21 12:42:04 (UTC-03:00)

Marcel Rodrigues <marcelgmr@gmail.com>

Use current terminal size as default.

diff --git a/main.c b/main.c
index b176757..9129984 100644
--- a/main.c
+++ b/main.c
@@ -8,6 +8,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <sys/ioctl.h>
+#include <termios.h>
 
 #include "term.h"
 #include "mbf.h"
@@ -230,8 +232,11 @@ main(int argc, char *argv[])
     int c;
     int ret;
     Term *term;
+    struct winsize size;
 
-    w = 80; h = 30;
+    ioctl(0, TIOCGWINSZ, &size);
+    h = size.ws_row;
+    w = size.ws_col;
     f = "uw-ttyp0-11.mbf";
     o = "con.gif";
     d = 1.0; m = FLT_MAX;