summaryrefslogtreecommitdiffstats
path: root/mbbsd/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/term.c')
-rw-r--r--mbbsd/term.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/mbbsd/term.c b/mbbsd/term.c
index bea4ec33..c1f5efd8 100644
--- a/mbbsd/term.c
+++ b/mbbsd/term.c
@@ -40,22 +40,38 @@ sig_term_resize(int sig)
void term_resize(int w, int h)
{
+ char changed = 0;
+ screen_backup_t scr;
+
Signal(SIGWINCH, SIG_IGN); /* Don't bother me! */
+
/* make sure reasonable size */
h = MAX(24, MIN(100, h));
w = MAX(80, MIN(200, w));
- // invoke terminal system resize
- resizeterm(h, w);
+ if (w != t_columns || h != t_lines)
+ {
+ scr_dump(&scr);
+ changed = 1;
+
+ // invoke terminal system resize
+ resizeterm(h, w);
- t_lines = h;
- t_columns = w;
+ t_lines = h;
+ t_columns = w;
+ }
scr_lns = t_lines; /* XXX: scr_lns �� t_lines �����򤣦P, ���������� */
b_lines = t_lines - 1;
p_lines = t_lines - 4;
Signal(SIGWINCH, sig_term_resize);
+
+ if (changed)
+ {
+ scr_restore(&scr);
+ redrawwin();
+ }
}
int