2 * Copyright notice from original mutt:
3 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
5 * This file is part of mutt-ng, see http://www.muttng.org/.
6 * It's licensed under the GNU General Public License,
7 * please see the file GPL in the top level source directory.
10 #include <lib-lib/lib-lib.h>
12 #if defined(HAVE_RESIZETERM)
15 #ifdef HAVE_SYS_IOCTL_H
16 # include <sys/ioctl.h>
17 #elif defined(HAVE_IOCTL_H)
21 #include <lib-ui/curses.h>
24 /* this routine should be called after receiving SIGWINCH */
25 void mutt_resize_screen (void)
35 if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
36 if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
43 if ((cp = getenv ("LINES")) != NULL) {
50 if ((cp = getenv ("COLUMNS")) != NULL)
55 resizeterm (rows, cols);
58 #endif /* defined(HAVE_RESIZETERM) */