resize works in fact :P
[apps/madtty.git] / madtty / madtty.c
index 4453345..ce9f256 100644 (file)
@@ -846,16 +846,20 @@ void madtty_keypress(madtty_t *rt, int keycode)
     const char *buf;
     int len;
 
+#if 0
+    if (keycode == KEY_F(1)) {
+#define MIN(a, b) ((a < (b)) ? a : (b))
+        kill(-rt->childpid, SIGWINCH);
+        rt->scroll_bot = MIN(rt->scroll_bot, rt->lines + rt->rows);
+        rt->curs_row = MIN(rt->curs_row, rt->lines + rt->rows);
+        printf(stderr, "%d\n", rt->rows);
+        return;
+    }
+#endif
     if (keycode >= 0 && keycode < KEY_MAX && keytable[keycode]) {
         buf = keytable[keycode];
         len = strlen(keytable[keycode]);
     } else {
-#if 0
-        if (keycode == KEY_F(3)) {
-            kill(-rt->childpid, SIGWINCH);
-            return;
-        }
-#endif
         buf = &c;
         len = 1;
     }