aboutsummaryrefslogtreecommitdiffhomepage
path: root/interface-ncurses.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-22 18:26:18 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-22 18:26:18 +0100
commited8202bd62e00509140d9f036bc813b60852bd16 (patch)
treeaf358e150789a57e53c84898897637e6bdb14f32 /interface-ncurses.cpp
parente62ee37ca5b7019ed63e66338a45630304340bed (diff)
downloadsciteco-ed8202bd62e00509140d9f036bc813b60852bd16.tar.gz
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
Diffstat (limited to 'interface-ncurses.cpp')
-rw-r--r--interface-ncurses.cpp5
1 files changed, 5 insertions, 0 deletions
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;