From: Pierre Habouzit Date: Thu, 8 Nov 2007 23:49:57 +0000 (+0100) Subject: resize works in fact :P X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=7a634f01490ab34dcddffdde5b5a3d5dd10f6de5;p=apps%2Fmadtty.git resize works in fact :P Signed-off-by: Pierre Habouzit --- 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; }