From 7a634f01490ab34dcddffdde5b5a3d5dd10f6de5 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Fri, 9 Nov 2007 00:49:57 +0100 Subject: [PATCH] resize works in fact :P Signed-off-by: Pierre Habouzit --- demo/boxshell.c | 2 +- madtty/madtty.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/demo/boxshell.c b/demo/boxshell.c index 7c9512d..c8ef22a 100644 --- a/demo/boxshell.c +++ b/demo/boxshell.c @@ -72,7 +72,7 @@ int main(void) 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, diff --git a/madtty/madtty.c b/madtty/madtty.c index 4453345..ce9f256 100644 --- a/madtty/madtty.c +++ b/madtty/madtty.c @@ -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; } -- 2.20.1