resize works in fact :P
authorPierre Habouzit <madcoder@debian.org>
Thu, 8 Nov 2007 23:49:57 +0000 (00:49 +0100)
committerPierre Habouzit <madcoder@debian.org>
Thu, 8 Nov 2007 23:49:57 +0000 (00:49 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
demo/boxshell.c
madtty/madtty.c

index 7c9512d..c8ef22a 100644 (file)
@@ -72,7 +72,7 @@ int main(void)
 
         while ((ch = getch()) != ERR) {
 #if 0
 
         while ((ch = getch()) != ERR) {
 #if 0
-            if (ch == KEY_F(3)) {
+            if (ch == KEY_F(1)) {
                 struct winsize ws = {
                     .ws_row = --rt->rows,
                     .ws_col = --rt->cols,
                 struct winsize ws = {
                     .ws_row = --rt->rows,
                     .ws_col = --rt->cols,
index 4453345..ce9f256 100644 (file)
@@ -846,16 +846,20 @@ void madtty_keypress(madtty_t *rt, int keycode)
     const char *buf;
     int len;
 
     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 (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;
     }
         buf = &c;
         len = 1;
     }