diff options
Diffstat (limited to 'mbbsd/term.c')
-rw-r--r-- | mbbsd/term.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/mbbsd/term.c b/mbbsd/term.c index 2ef13ed0..202ea582 100644 --- a/mbbsd/term.c +++ b/mbbsd/term.c @@ -40,25 +40,15 @@ sig_term_resize(int sig) void term_resize(int w, int h) { - screenline_t *new_picture; - Signal(SIGWINCH, SIG_IGN); /* Don't bother me! */ /* make sure reasonable size */ h = MAX(24, MIN(100, h)); w = MAX(80, MIN(200, w)); - if (h > t_lines && big_picture) { - new_picture = (screenline_t *) - calloc(h, sizeof(screenline_t)); - if (new_picture == NULL) { - syslog(LOG_ERR, "calloc(): %m"); - return; - } - memcpy(new_picture, big_picture, t_lines * sizeof(screenline_t)); - free(big_picture); - big_picture = new_picture; - } + // invoke terminal system resize + resizescr(h, w); + t_lines = h; t_columns = w; scr_lns = t_lines; /* XXX: scr_lns 跟 t_lines 有什麼不同, 為何分成兩個 */ |