diff --git a/libs/console/console.c b/libs/console/console.c index 889ccf73a..43bcc5131 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -45,6 +45,10 @@ int con_linewidth; // characters across screen static plugin_t *con_module; +static void (*const complete)(inputline_t *) = Con_BasicCompleteCommandLine; +static inputline_t *(*const create)(int, int, char) = Con_CreateInputLine; +static void (*const display)(const char **, int) = Con_DisplayList; + void Con_Init (const char *plugin_name) { diff --git a/libs/console/server.c b/libs/console/server.c index 36bf6bc88..033375f45 100644 --- a/libs/console/server.c +++ b/libs/console/server.c @@ -45,6 +45,9 @@ # include #endif +#include +#include +#include #include #include "QF/cmd.h" @@ -104,6 +107,13 @@ C_ExecLine (const char *line) line++; Cbuf_AddText (line); } + +static void +sigwinch (int sig) +{ + ungetch (KEY_RESIZE); + signal (SIGWINCH, sigwinch); +} #endif @@ -115,6 +125,8 @@ C_Init (void) "set to 0 to disable curses server console"); use_curses = curses->int_val; if (use_curses) { + signal (SIGWINCH, sigwinch); + initscr (); start_color (); cbreak (); @@ -220,6 +232,16 @@ C_ProcessInput (void) const char *text; switch (ch) { + case KEY_RESIZE: + { + struct winsize size; + + if (ioctl (fileno (stdout), TIOCGWINSZ, &size) == 0) { + resizeterm (size.ws_row, size.ws_col); + wrefresh (curscr); + } + } + break; case KEY_ENTER: case '\n': case '\r': diff --git a/qw/source/sv_sys_unix.c b/qw/source/sv_sys_unix.c index 022d1b04d..742d18df4 100644 --- a/qw/source/sv_sys_unix.c +++ b/qw/source/sv_sys_unix.c @@ -149,7 +149,8 @@ main (int argc, const char *argv[]) if (svs.num_clients || !sys_dead_sleep->int_val) timeout = &_timeout; - if (select (net_socket + 1, &fdset, NULL, NULL, timeout) == -1) + if (select (net_socket + 1, &fdset, NULL, NULL, timeout) == -1 + && errno != EINTR) continue; stdin_ready = FD_ISSET (0, &fdset);