From ed8202bd62e00509140d9f036bc813b60852bd16 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 22 Nov 2012 18:26:18 +0100 Subject: support PDCurses user-resizing of the terminal * there might be curses implementations that don't support KEY_RESIZE at all * PDCurses does but only with the X11 and SDL versions * on Windows, the console version might use the SDL DLL (by replacing pdcurses.dll) so it's fair to keep the window resizing code compiled into the binary. * also it's necessary to call resize_term() to update internal structures * should also work with the Win32a port of PDCurses --- interface-ncurses.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'interface-ncurses.cpp') diff --git a/interface-ncurses.cpp b/interface-ncurses.cpp index a621474..be18b1f 100644 --- a/interface-ncurses.cpp +++ b/interface-ncurses.cpp @@ -300,10 +300,15 @@ InterfaceNCurses::event_loop(void) key = wgetch(cmdline_window); switch (key) { +#ifdef KEY_RESIZE case ERR: case KEY_RESIZE: +#ifdef PDCURSES + resize_term(0, 0); +#endif resize_all_windows(); break; +#endif case ESCAPE_SURROGATE: cmdline_keypress('\x1B'); break; -- cgit v1.2.3